pidgin: f600b0f7: jabber: Fix removing a self-contact.

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Dec 9 23:11:06 EST 2009


-----------------------------------------------------------------
Revision: f600b0f7b9a2c37bb1711a0ae48638829754ba66
Ancestor: f1a655d2ea516fdbd9959af072854c601e839c1c
Author: darkrain42 at pidgin.im
Date: 2009-12-10T03:15:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f600b0f7b9a2c37bb1711a0ae48638829754ba66

Modified files:
        libpurple/protocols/jabber/roster.c

ChangeLog: 

jabber: Fix removing a self-contact.

Need to check for subscription="remove" before checking if it's a self-contact.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/roster.c	153d1d579b17c98eeb1d0cd271b441ec2f957c90
+++ libpurple/protocols/jabber/roster.c	81456d58d3f1b1f9a377119a046b7702061092fe
@@ -223,18 +223,18 @@ void jabber_roster_parse(JabberStream *j
 			continue;
 
 		if(subscription) {
-			if (jb == js->user_jb)
+			if (g_str_equal(subscription, "remove"))
+				jb->subscription = JABBER_SUB_REMOVE;
+			else if (jb == js->user_jb)
 				jb->subscription = JABBER_SUB_BOTH;
-			else if(!strcmp(subscription, "none"))
+			else if (g_str_equal(subscription, "none"))
 				jb->subscription = JABBER_SUB_NONE;
-			else if(!strcmp(subscription, "to"))
+			else if (g_str_equal(subscription, "to"))
 				jb->subscription = JABBER_SUB_TO;
-			else if(!strcmp(subscription, "from"))
+			else if (g_str_equal(subscription, "from"))
 				jb->subscription = JABBER_SUB_FROM;
-			else if(!strcmp(subscription, "both"))
+			else if (g_str_equal(subscription, "both"))
 				jb->subscription = JABBER_SUB_BOTH;
-			else if(!strcmp(subscription, "remove"))
-				jb->subscription = JABBER_SUB_REMOVE;
 		}
 
 		if(purple_strequal(ask, "subscribe"))


More information about the Commits mailing list