changeset 30026:4c3cc12c3a69

merge of '4c978163a43dcf3f47d33ebb76d86d9be5f52a24' and 'fbc5141857873eae0512b7cecad373ea0612207e'
author Daniel Atallah <daniel.atallah@gmail.com>
date Sun, 21 Mar 2010 00:34:29 +0000
parents 182b6bc805ab (current diff) eb72ae3357dc (diff)
children bab8917b8b5c
files
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c	Sat Mar 20 21:10:57 2010 +0000
+++ b/libpurple/protocols/jabber/presence.c	Sun Mar 21 00:34:29 2010 +0000
@@ -670,7 +670,7 @@
 		if (chat->muc) {
 			if (g_slist_find(presence->chat_info.codes, GINT_TO_POINTER(110)))
 				is_our_resource = TRUE;
-			
+
 			if (g_slist_find(presence->chat_info.codes, GINT_TO_POINTER(301))) {
 				/* XXX: We got banned.  YAY! (No GIR, that's bad) */
 			}
@@ -744,15 +744,15 @@
 
 				g_free(reason);
 			}
-			
+
 			if (g_slist_find(presence->chat_info.codes, GINT_TO_POINTER(321))) {
 				/* XXX: removed due to an affiliation change */
 			}
-			
+
 			if (g_slist_find(presence->chat_info.codes, GINT_TO_POINTER(322))) {
 				/* XXX: removed because room is now members-only */
 			}
-			
+
 			if (g_slist_find(presence->chat_info.codes, GINT_TO_POINTER(332))) {
 				/* XXX: removed due to system shutdown */
 			}
@@ -996,7 +996,7 @@
 		JabberPresenceHandler *pih;
 		if (child->type != XMLNODE_TYPE_TAG)
 			continue;
-	
+
 		key = g_strdup_printf("%s %s", child->name, xmlnode_get_namespace(child));
 		pih = g_hash_table_lookup(presence_handlers, key);
 		g_free(key);
@@ -1052,11 +1052,15 @@
 	}
 
 out:
+	while (presence.chat_info.codes)
+		presence.chat_info.codes =
+			g_slist_delete_link(presence.chat_info.codes,
+			                    presence.chat_info.codes);
+
+	g_free(presence.status);
+	g_free(presence.vcard_avatar_hash);
 	g_free(presence.nickname);
-	g_free(presence.status);
 	jabber_id_free(presence.jid_from);
-	g_free(presence.nickname);
-	g_free(presence.vcard_avatar_hash);
 }
 
 void jabber_presence_subscription_set(JabberStream *js, const char *who, const char *type)