changeset 25818:370d8eba2ce0

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.
author Paul Aurich <paul@darkrain42.org>
date Wed, 21 Jan 2009 20:58:07 +0000
parents 9195955395b6
children ba8f51cb3691
files libpurple/protocols/jabber/buddy.c
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Wed Jan 21 20:16:22 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Wed Jan 21 20:58:07 2009 +0000
@@ -483,27 +483,24 @@
 	}
 
 	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);
 }
 
 /*