diff options
author | Belgin Știrbu <belginstirbu@hotmail.com> | 2022-05-23 20:30:57 -0500 |
---|---|---|
committer | Belgin Știrbu <belginstirbu@hotmail.com> | 2022-05-23 20:30:57 -0500 |
commit | e8556ffc38347934ea48f9b4d54caebf826d442f (patch) | |
tree | 224b8c30c484df0bb7161ec4bd349e0c65bb80a5 | |
parent | a5f823c4ebb6e563c0cab2dcee4f21edb8d1807e (diff) | |
download | pidgin-e8556ffc38347934ea48f9b4d54caebf826d442f.tar.gz |
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/
-rw-r--r-- | libpurple/protocols/jabber/jabber.c | 4 | ||||
-rw-r--r-- | pidgin/gtkprivacy.c | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 8a224fff57..1f1318a065 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1877,10 +1877,6 @@ static void jabber_blocklist_parse(JabberStream *js, const char *from, 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. diff --git a/pidgin/gtkprivacy.c b/pidgin/gtkprivacy.c index 5463d0b3ac..b1bf284afe 100644 --- a/pidgin/gtkprivacy.c +++ b/pidgin/gtkprivacy.c @@ -89,6 +89,8 @@ static const size_t menu_entry_count = sizeof(menu_entries) / sizeof(*menu_entri 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 @@ select_account_cb(GtkWidget *dropdown, PurpleAccount *account, rebuild_allow_list(dialog); rebuild_block_list(dialog); + + type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog); } /* @@ -299,6 +303,9 @@ remove_cb(GtkWidget *button, PidginPrivacyDialog *dialog) 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 @@ removeall_cb(GtkWidget *button, PidginPrivacyDialog *dialog) 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 @@ privacy_dialog_new(void) 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 @@ confirm_permit_block_cb(PidginPrivacyRequestData *data, int option) 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 |