# HG changeset patch # User Sadrul Habib Chowdhury # Date 1212469971 0 # Node ID d9767a3993af60bb410729298c3469a90edfffab # Parent 242fd82b5fe6c87ae3bf469eb0d3961e53f9ea42# Parent e61fd3bf90198a2675519689676162ab359b4d7e merge of '0de80ccd44f6ce7fe6942baa1e0dfc95a2878d05' and 'e7fb4056cfb091389c5c657b97f95365799165e6' diff -r 242fd82b5fe6 -r d9767a3993af libpurple/privacy.c --- a/libpurple/privacy.c Tue Jun 03 03:53:14 2008 +0000 +++ b/libpurple/privacy.c Tue Jun 03 05:12:51 2008 +0000 @@ -241,6 +241,7 @@ gboolean restore) { GSList *list; + PurplePrivacyType type = account->perm_deny; switch (account->perm_deny) { case PURPLE_PRIVACY_ALLOW_ALL: @@ -254,10 +255,12 @@ case PURPLE_PRIVACY_DENY_ALL: if (!restore) { /* Empty the allow-list. */ + const char *norm = purple_normalize(account, who); for (list = account->permit; list != NULL;) { - char *who = list->data; + char *person = list->data; list = list->next; - purple_privacy_permit_remove(account, who, local); + if (strcmp(norm, person) != 0) + purple_privacy_permit_remove(account, person, local); } } purple_privacy_permit_add(account, who, local); @@ -273,6 +276,10 @@ default: g_return_if_reached(); } + + /* Notify the server if the privacy setting was changed */ + if (type != account->perm_deny && purple_account_is_connected(account)) + serv_set_permit_deny(purple_account_get_connection(account)); } /* @@ -286,15 +293,18 @@ gboolean restore) { GSList *list; + PurplePrivacyType type = account->perm_deny; switch (account->perm_deny) { case PURPLE_PRIVACY_ALLOW_ALL: if (!restore) { /* Empty the deny-list. */ + const char *norm = purple_normalize(account, who); for (list = account->deny; list != NULL; ) { char *person = list->data; list = list->next; - purple_privacy_deny_remove(account, person, local); + if (strcmp(norm, person) != 0) + purple_privacy_deny_remove(account, person, local); } } purple_privacy_deny_add(account, who, local); @@ -318,6 +328,10 @@ default: g_return_if_reached(); } + + /* Notify the server if the privacy setting was changed */ + if (type != account->perm_deny && purple_account_is_connected(account)) + serv_set_permit_deny(purple_account_get_connection(account)); } gboolean