diff src/privacy.c @ 6378:01289157fc37

[gaim-migrate @ 6883] This solves the problem of 50 billion dialogs on your screen and server requests to re-authorize or re-deny everybody on every privacy list in your protocol. "Oops." committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 05 Aug 2003 18:59:57 +0000
parents 72023626d5b8
children feb3d21a7794
line wrap: on
line diff
--- a/src/privacy.c	Tue Aug 05 18:31:00 2003 +0000
+++ b/src/privacy.c	Tue Aug 05 18:59:57 2003 +0000
@@ -28,7 +28,8 @@
 static GaimPrivacyUiOps *privacy_ops = NULL;
 
 gboolean
-gaim_privacy_permit_add(GaimAccount *account, const char *who)
+gaim_privacy_permit_add(GaimAccount *account, const char *who,
+						gboolean local_only)
 {
 	GSList *l;
 	char *name;
@@ -50,7 +51,7 @@
 
 	account->permit = g_slist_append(account->permit, g_strdup(who));
 
-	if (gaim_account_is_connected(account))
+	if (!local_only && gaim_account_is_connected(account))
 		serv_add_permit(gaim_account_get_connection(account), who);
 
 	gaim_blist_save();
@@ -62,7 +63,8 @@
 }
 
 gboolean
-gaim_privacy_permit_remove(GaimAccount *account, const char *who)
+gaim_privacy_permit_remove(GaimAccount *account, const char *who,
+						   gboolean local_only)
 {
 	GSList *l;
 	char *name;
@@ -85,7 +87,7 @@
 	account->permit = g_slist_remove(account->permit, l->data);
 	g_free(l->data);
 
-	if (gaim_account_is_connected(account))
+	if (!local_only && gaim_account_is_connected(account))
 		serv_rem_deny(gaim_account_get_connection(account), who);
 
 	gaim_blist_save();
@@ -97,7 +99,8 @@
 }
 
 gboolean
-gaim_privacy_deny_add(GaimAccount *account, const char *who)
+gaim_privacy_deny_add(GaimAccount *account, const char *who,
+					  gboolean local_only)
 {
 	GSList *l;
 	char *name;
@@ -119,7 +122,7 @@
 
 	account->deny = g_slist_append(account->deny, g_strdup(who));
 
-	if (gaim_account_is_connected(account))
+	if (!local_only && gaim_account_is_connected(account))
 		serv_add_deny(gaim_account_get_connection(account), who);
 
 	gaim_blist_save();
@@ -131,7 +134,8 @@
 }
 
 gboolean
-gaim_privacy_deny_remove(GaimAccount *account, const char *who)
+gaim_privacy_deny_remove(GaimAccount *account, const char *who,
+						 gboolean local_only)
 {
 	GSList *l;
 	char *name;
@@ -154,7 +158,7 @@
 	account->deny = g_slist_remove(account->deny, l->data);
 	g_free(l->data);
 
-	if (gaim_account_is_connected(account)) {
+	if (!local_only && gaim_account_is_connected(account)) {
 		gaim_debug(GAIM_DEBUG_INFO, "privacy",
 				   "Removing %s from server-side deny list\n", who);
 		serv_rem_deny(gaim_account_get_connection(account), who);