pidgin: 0ccc5bec: Add a few more roster debug messages and...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Jun 3 11:55:41 EDT 2009


-----------------------------------------------------------------
Revision: 0ccc5bec4e4a170360657766b31024248e1303ff
Ancestor: a09da5a6a55e5cc2b8ae6417703c39e4de4ce470
Author: darkrain42 at pidgin.im
Date: 2009-06-03T15:50:08
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0ccc5bec4e4a170360657766b31024248e1303ff

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

ChangeLog: 

Add a few more roster debug messages and improve.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/roster.c	c74f6ba37b3c8508de80cb59308eeb0a4d7e1416
+++ libpurple/protocols/jabber/roster.c	42830f4a1a27bc9839d76f96a235a84884294971
@@ -282,14 +282,23 @@ static void jabber_roster_update(JabberS
 		return;
 
 	if(grps) {
+		GString *out = g_string_new(NULL);
 		groups = grps;
+
 		for (l = groups; l; l = l->next) {
-			purple_debug_info("jabber", "jabber_roster_update(%s): [Source: grps]: groups contains %s",
-							  name, (const char *)l->data);
+			out = g_string_append(out, (const char *)l->data);
+			if (l->next)
+				out = g_string_append(out, ", ");
 		}
 
+		purple_debug_info("jabber", "jabber_roster_update(%s): [Source: grps]: groups: %s\n",
+		                  name, out->str);
+		g_string_free(out, TRUE);
+
 	} else {
 		GSList *buddies = purple_find_buddies(js->gc->account, name);
+		GString *out = g_string_new(NULL);
+
 		if(!buddies)
 			return;
 		while(buddies) {
@@ -299,9 +308,14 @@ static void jabber_roster_update(JabberS
 			buddies = g_slist_remove(buddies, b);
 		}
 		for (l = groups; l; l = l->next) {
-			purple_debug_info("jabber", "jabber_roster_update(%s): [Source: local blist]: groups contains %s",
-							  name, (const char *)l->data);
+			out = g_string_append(out, (const char *)l->data);
+			if (l->next)
+				out = g_string_append(out, ", ");
 		}
+
+		purple_debug_info("jabber", "jabber_roster_update(%s): [Source: local blist]: groups: %s\n",
+		                  name, out->str);
+		g_string_free(out, TRUE);
 	}
 
 	iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:roster");
@@ -349,6 +363,9 @@ void jabber_roster_add_buddy(PurpleConne
 
 	jb = jabber_buddy_find(js, name, FALSE);
 
+	purple_debug_info("jabber", "jabber_roster_add_buddy(): Adding %s\n",
+	                  name);
+
 	jabber_roster_update(js, who, NULL);
 
 	my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
@@ -378,7 +395,7 @@ void jabber_roster_alias_change(PurpleCo
 	if(b != NULL) {
 		purple_blist_alias_buddy(b, alias);
 
-		purple_debug_info("jabber", "jabber_roster_alias_change(): Aliased %s to %s",
+		purple_debug_info("jabber", "jabber_roster_alias_change(): Aliased %s to %s\n",
 				name, alias);
 
 		jabber_roster_update(gc->proto_data, name, NULL);
@@ -408,8 +425,8 @@ void jabber_roster_group_change(PurpleCo
 		buddies = g_slist_remove(buddies, b);
 	}
 
-	purple_debug_info("jabber", "jabber_roster_group_change(): Moving %s from %s to %s",
-				name, old_group, new_group);
+	purple_debug_info("jabber", "jabber_roster_group_change(): Moving %s from %s to %s\n",
+	                  name, old_group, new_group);
 
 	jabber_roster_update(gc->proto_data, name, groups);
 	g_slist_free(groups);
@@ -444,8 +461,8 @@ void jabber_roster_remove_buddy(PurpleCo
 			buddies = g_slist_remove(buddies, tmpbuddy);
 		}
 
-		purple_debug_info("jabber", "jabber_roster_remove_buddy(): Removing %s",
-				buddy->name);
+		purple_debug_info("jabber", "jabber_roster_remove_buddy(): Removing %s from %s\n",
+		                  purple_buddy_get_name(buddy), purple_group_get_name(group));
 
 		jabber_roster_update(gc->proto_data, name, groups);
 		g_slist_free(groups);
@@ -458,6 +475,9 @@ void jabber_roster_remove_buddy(PurpleCo
 		xmlnode_set_attrib(item, "jid", name);
 		xmlnode_set_attrib(item, "subscription", "remove");
 
+		purple_debug_info("jabber", "jabber_roster_remove_buddy(): Removing %s\n",
+		                  purple_buddy_get_name(buddy));
+
 		jabber_iq_send(iq);
 	}
 }


More information about the Commits mailing list