pidgin/pidgin

Fix GtkPrivacy to respect privacy settings
release-2.x.y
24 months ago, Belgin Știrbu
ccd35a6add9c
Parents 851d7f3cce88
Children 1d02278206d2
Fix GtkPrivacy to respect privacy settings

This patch also makes the Buddy List refresh when the user changes
a setting in the GtkPrivacy window.

Testing Done:
Changed privacy settings and they were saved and restored as expected.

Bugs closed: PIDGIN-17137

Reviewed at https://reviews.imfreedom.org/r/1463/
--- a/libpurple/protocols/jabber/jabber.c Fri May 20 15:14:37 2022 -0500
+++ b/libpurple/protocols/jabber/jabber.c Mon May 23 20:30:57 2022 -0500
@@ -1877,10 +1877,6 @@
if (type == JABBER_IQ_ERROR || blocklist == NULL)
return;
- /* This is the only privacy method supported by XEP-0191 */
- if (account->perm_deny != PURPLE_PRIVACY_DENY_USERS)
- account->perm_deny = PURPLE_PRIVACY_DENY_USERS;
-
/*
* TODO: When account->deny is something more than a hash table, this can
* be re-written to find the set intersection and difference.
--- a/pidgin/gtkprivacy.c Fri May 20 15:14:37 2022 -0500
+++ b/pidgin/gtkprivacy.c Mon May 23 20:30:57 2022 -0500
@@ -89,6 +89,8 @@
static PidginPrivacyDialog *privacy_dialog = NULL;
+static void type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog);
+
static void
rebuild_allow_list(PidginPrivacyDialog *dialog)
{
@@ -219,6 +221,8 @@
rebuild_allow_list(dialog);
rebuild_block_list(dialog);
+
+ type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog);
}
/*
@@ -299,6 +303,9 @@
purple_privacy_deny_remove(dialog->account, name, FALSE);
g_free(name);
+
+ purple_blist_schedule_save();
+ pidgin_blist_refresh(purple_get_blist());
}
static void
@@ -318,6 +325,9 @@
else
purple_privacy_deny_remove(dialog->account, user, FALSE);
}
+
+ purple_blist_schedule_save();
+ pidgin_blist_refresh(purple_get_blist());
}
static void
@@ -410,7 +420,7 @@
button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog);
dialog->close_button = button;
- type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog);
+ select_account_cb(dropdown, dialog->account, dialog);
#if 0
if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) {
gtk_widget_show(dialog->allow_widget);
@@ -466,6 +476,9 @@
purple_privacy_allow(data->account, data->name, FALSE, FALSE);
destroy_request_data(data);
+
+ purple_blist_schedule_save();
+ pidgin_blist_refresh(purple_get_blist());
}
static void