cpw.darkrain42.xmpp.avatars: 1bc6b99a: Send presence updates from jabber_set_in...

paul at darkrain42.org paul at darkrain42.org
Fri Jan 23 22:27:38 EST 2009


-----------------------------------------------------------------
Revision: 1bc6b99a4faf1761a68b84188619623f37b7e597
Ancestor: d70cdd1fd161f70a868170d8a72eadfbecfc966c
Author: paul at darkrain42.org
Date: 2009-01-21T20:58:07
Branch: im.pidgin.cpw.darkrain42.xmpp.avatars
URL: http://d.pidgin.im/viewmtn/revision/info/1bc6b99a4faf1761a68b84188619623f37b7e597

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

ChangeLog: 

Send presence updates from jabber_set_info, not jabber_set_buddy_icon.

If we change our photo at login, that may happen after we've sent initial
presence, so we need to re-send presence with the vcard-temp included.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c	8035cd1a1fe864b3e7ac970164fb60d44ae5df30
+++ libpurple/protocols/jabber/buddy.c	87667946d0632421b318b9983c4ae8635354f4c3
@@ -483,27 +483,24 @@ void jabber_set_info(PurpleConnection *g
 	}
 
 	if (vc_node != NULL) {
+		PurpleAccount *account = purple_connection_get_account(js->gc);
+
 		iq = jabber_iq_new(js, JABBER_IQ_SET);
 		xmlnode_insert_child(iq->node, vc_node);
 		jabber_iq_send(iq);
+
+		/* Send presence to update vcard-temp:x:update */
+		jabber_presence_send(account, purple_account_get_active_status(account));
 	}
 }
 
 void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img)
 {
-	PurplePresence *gpresence;
-	PurpleStatus *status;
-
 	jabber_avatar_set(gc->proto_data, img);
 	/* vCard avatars do not have an image type requirement so update our
 	 * vCard avatar regardless of image type for those poor older clients
 	 */
 	jabber_set_info(gc, purple_account_get_user_info(gc->account));
-
-	/* TODO: Call this in jabber_set_info() if avatar changed? */
-	gpresence = purple_account_get_presence(gc->account);
-	status = purple_presence_get_active_status(gpresence);
-	jabber_presence_send(gc->account, status);
 }
 
 /*


More information about the Commits mailing list