soc.2009.privacy_rewrite: a01627c9: changes in jabber prpl to follow new way...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Sat Aug 1 03:50:42 EDT 2009


-----------------------------------------------------------------
Revision: a01627c9769e13e9d25d0d2690efd47c13604b64
Ancestor: 993182acc28bc62a37456d26842d7c5a562f8aeb
Author: sulabh at soc.pidgin.im
Date: 2009-07-28T08:09:59
Branch: im.pidgin.soc.2009.privacy_rewrite
URL: http://d.pidgin.im/viewmtn/revision/info/a01627c9769e13e9d25d0d2690efd47c13604b64

Modified files:
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h
        libpurple/protocols/jabber/libxmpp.c

ChangeLog: 

changes in jabber prpl to follow new way to call list change api through prpl functions 

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	29cca66d9f4892e181f32afbb5cdcd461e0f6d80
+++ libpurple/protocols/jabber/jabber.c	464e37ce0b4007c32fd5bc97f8e2c9a32deb9f7a
@@ -1775,7 +1775,7 @@ void jabber_request_block_list(JabberStr
 	jabber_iq_send(iq);
 }
 
-void jabber_add_deny(PurpleConnection *gc, const char *who)
+static void jabber_add_deny(PurpleConnection *gc, const char *who)
 {
 	JabberStream *js;
 	JabberIq *iq;
@@ -1809,7 +1809,7 @@ void jabber_add_deny(PurpleConnection *g
 	jabber_iq_send(iq);
 }
 
-void jabber_rem_deny(PurpleConnection *gc, const char *who)
+static void jabber_rem_deny(PurpleConnection *gc, const char *who)
 {
 	JabberStream *js;
 	JabberIq *iq;
@@ -1839,6 +1839,48 @@ void jabber_rem_deny(PurpleConnection *g
 	jabber_iq_send(iq);
 }
 
+void jabber_privacy_list_add(PurpleConnection *gc, PurplePrivacyListType list_type, const char *who)
+{
+	if (!who || who[0] == '\0')
+		return;
+
+	switch(list_type)
+	{
+		case PURPLE_PRIVACY_ALLOW_LIST:
+		case PURPLE_PRIVACY_BLOCK_MESSAGE_LIST:
+		case PURPLE_PRIVACY_BUDDY_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:
+			jabber_add_deny(gc, who);
+			break;
+	}
+	return;
+}
+
+void jabber_privacy_list_remove(PurpleConnection *gc, PurplePrivacyListType list_type, const char *who)
+{
+	if (!who || who[0] == '\0')
+		return;
+
+	switch(list_type)
+	{
+		case PURPLE_PRIVACY_ALLOW_LIST:
+		case PURPLE_PRIVACY_BLOCK_MESSAGE_LIST:
+		case PURPLE_PRIVACY_BUDDY_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:
+			jabber_rem_deny(gc, who);
+			break;
+	}
+	return;
+}
+
 void jabber_add_feature(const char *namespace, JabberFeatureEnabled cb) {
 	JabberFeature *feat;
 
============================================================
--- libpurple/protocols/jabber/jabber.h	e9b32044d2a64e63b1b74fef19036e86f88aa0ea
+++ libpurple/protocols/jabber/jabber.h	b58cf4199d4cf1c8e353cb64d361ce55516861b7
@@ -354,8 +354,8 @@ void jabber_request_block_list(JabberStr
                                  JabberIqType type, const char *id,
                                  xmlnode *child);
 void jabber_request_block_list(JabberStream *js);
-void jabber_add_deny(PurpleConnection *gc, const char *who);
-void jabber_rem_deny(PurpleConnection *gc, const char *who);
+void jabber_privacy_list_add(PurpleConnection *gc, PurplePrivacyListType list_type, const char *who);
+void jabber_privacy_list_remove(PurpleConnection *gc, PurplePrivacyListType list_type, const char *who);
 void jabber_keepalive(PurpleConnection *gc);
 void jabber_register_gateway(JabberStream *js, const char *gateway);
 void jabber_register_account(PurpleAccount *account);
============================================================
--- libpurple/protocols/jabber/libxmpp.c	54af098c2be2089acb3145ed4e1bda05a903e19d
+++ libpurple/protocols/jabber/libxmpp.c	4691e959d0c5bb15527dee6216ac9ddc12585779
@@ -78,10 +78,8 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,							/* add_buddies */
 	jabber_roster_remove_buddy,		/* remove_buddy */
 	NULL,							/* remove_buddies */
-	NULL,							/* add_permit */
-	jabber_add_deny,				/* add_deny */
-	NULL,							/* rem_permit */
-	jabber_rem_deny,				/* rem_deny */
+	jabber_privacy_list_add,		/* add_permit */
+	jabber_privacy_list_remove,				/* add_deny */
 	NULL,							/* set_permit_deny */
 	jabber_chat_join,				/* join_chat */
 	NULL,							/* reject_chat */


More information about the Commits mailing list