soc.2009.privacy_rewrite: 993182ac: change how UI calls MSN to add/remove co..

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Mon Jul 27 12:20:49 EDT 2009


-----------------------------------------------------------------
Revision: 993182acc28bc62a37456d26842d7c5a562f8aeb
Ancestor: 5d9894d9b4a0dafa5e33ca5d40e4fe4c3cb20bdd
Author: sulabh at soc.pidgin.im
Date: 2009-07-24T12:56:02
Branch: im.pidgin.soc.2009.privacy_rewrite
URL: http://d.pidgin.im/viewmtn/revision/info/993182acc28bc62a37456d26842d7c5a562f8aeb

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

change how UI calls MSN to add/remove contacts from the privacy lists.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	33a7e5e2c771e3158edb772eec77181fc74aa1f8
+++ libpurple/protocols/msn/msn.c	e7a00695948d4566f4eab6766eb18ac10e262da6
@@ -1576,6 +1576,52 @@ msn_rem_deny(PurpleConnection *gc, const
 		msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL);
 }
 
+static void msn_privacy_list_add(PurpleConnection *gc, PurplePrivacyListType list_type, const char *name)
+{
+	if (!name || name[0] == '\0')
+		return;
+
+	switch(list_type)
+	{
+		case PURPLE_PRIVACY_BUDDY_LIST:
+		case PURPLE_PRIVACY_BLOCK_MESSAGE_LIST:
+		case PURPLE_PRIVACY_VISIBLE_LIST:
+		case PURPLE_PRIVACY_INVISIBLE_LIST:
+			/* either not supported or not the right place to edit the list */
+			break;
+		case PURPLE_PRIVACY_BLOCK_BOTH_LIST:
+			msn_add_deny(gc, name);
+			break;
+		case PURPLE_PRIVACY_ALLOW_LIST:
+			msn_add_permit(gc, name);
+			break;
+	}
+	return;
+}
+
+static void msn_privacy_list_remove(PurpleConnection *gc, PurplePrivacyListType list_type, const char *name)
+{
+	if (!name || name[0] == '\0')
+		return;
+
+	switch(list_type)
+	{
+		case PURPLE_PRIVACY_BUDDY_LIST:
+		case PURPLE_PRIVACY_BLOCK_MESSAGE_LIST:
+		case PURPLE_PRIVACY_VISIBLE_LIST:
+		case PURPLE_PRIVACY_INVISIBLE_LIST:
+			/* either not supported or not the right place to edit the list */
+			break;
+		case PURPLE_PRIVACY_BLOCK_BOTH_LIST:
+			msn_rem_deny(gc, name);
+			break;
+		case PURPLE_PRIVACY_ALLOW_LIST:
+			msn_rem_permit(gc, name);
+			break;
+	}
+	return;
+}
+
 static void
 msn_set_permit_deny(PurpleConnection *gc)
 {
@@ -2538,10 +2584,8 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,					/* add_buddies */
 	msn_rem_buddy,			/* remove_buddy */
 	NULL,					/* remove_buddies */
-	msn_add_permit,			/* add_permit */
-	msn_add_deny,			/* add_deny */
-	msn_rem_permit,			/* rem_permit */
-	msn_rem_deny,			/* rem_deny */
+	msn_privacy_list_add,		/* privacy_list_add */
+	msn_privacy_list_remove,	/* privacy_list_remove */
 	msn_set_permit_deny,	/* set_permit_deny */
 	NULL,					/* join_chat */
 	NULL,					/* reject chat invite */


More information about the Commits mailing list