diff libpurple/protocols/jabber/presence.c @ 25705:e23b447aa5ca

propagate from branch 'im.pidgin.pidgin' (head e3ceb09b71185a9074ce73733f2a65b437c9a545) to branch 'im.pidgin.soc.2008.vv' (head a94b36f0065825b75de573746f680ae616b34f41)
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 16 Jul 2008 21:55:08 +0000
parents 3da0957e7821 74960bf43dae
children adf153852bcf
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c	Wed Jul 16 21:42:13 2008 +0000
+++ b/libpurple/protocols/jabber/presence.c	Wed Jul 16 21:55:08 2008 +0000
@@ -141,6 +141,11 @@
 	/* check for buzz support */
 	allowBuzz = purple_status_get_attr_boolean(status,"buzz");
 	/* changing the buzz state has to trigger a re-broadcasting of the presence for caps */
+
+	if (js->googletalk && stripped == NULL && purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) {
+		tune = purple_presence_get_status(p, "tune");
+		stripped = jabber_google_presence_outgoing(tune);
+	}
 	
 #define CHANGED(a,b) ((!a && b) || (a && a[0] == '\0' && b && b[0] != '\0') || \
 					  (a && !b) || (a && a[0] != '\0' && b && b[0] == '\0') || (a && b && strcmp(a,b)))
@@ -149,11 +154,6 @@
 		js->old_priority != priority || CHANGED(js->old_avatarhash, js->avatar_hash)) {
 		js->allowBuzz = allowBuzz;
 
-		if (js->googletalk && stripped == NULL && purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) {
-			tune = purple_presence_get_status(p, "tune");
-			stripped = jabber_google_presence_outgoing(tune);
-		}
-
 		presence = jabber_presence_create_js(js, state, stripped, priority);
 
 		if(js->avatar_hash) {
@@ -178,9 +178,9 @@
 		js->old_avatarhash = g_strdup(js->avatar_hash);
 		js->old_state = state;
 		js->old_priority = priority;
-		g_free(stripped);
 	}
-					  	
+	g_free(stripped);
+
 	/* next, check if there are any changes to the tune values */
 	tune = purple_presence_get_status(p, "tune");
 	if (tune && purple_status_is_active(tune)) {