pidgin.next.major: 450500bb: Update js->initial_avatar_hash if the us...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Apr 12 20:25:47 EDT 2011


----------------------------------------------------------------------
Revision: 450500bbc8ff7635e5f8bbe45379ffe765d898cc
Parent:   7948c6fe75d253cdd840bc9d291784cdbd493694
Author:   markdoliner at pidgin.im
Date:     04/12/11 20:22:29
Branch:   im.pidgin.pidgin.next.major
URL: http://d.pidgin.im/viewmtn/revision/info/450500bbc8ff7635e5f8bbe45379ffe765d898cc

Changelog: 

Update js->initial_avatar_hash if the user tries to set the icon before
we've received our self vcard.  This is the other half of a fix to get
rid of a race condition where the user's icon wouldn't get set correctly
if they set it while connecting.

Changes against parent 7948c6fe75d253cdd840bc9d291784cdbd493694

  patched  libpurple/protocols/jabber/buddy.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c	b147c3a23f792a8bb90ab97c1d14cb85a37859fd
+++ libpurple/protocols/jabber/buddy.c	a0a76270f5f34b992f3d837bccf045a932cc332e
@@ -467,8 +467,20 @@ void jabber_set_info(PurpleConnection *g
 
 	/* if we haven't grabbed the remote vcard yet, we can't
 	 * assume that what we have here is correct */
-	if(!js->vcard_fetched)
+	if(!js->vcard_fetched) {
+		PurpleStoredImage *image;
+		g_free(js->initial_avatar_hash);
+		image = purple_buddy_icons_find_account_icon(purple_connection_get_account(gc));
+		if (image != NULL) {
+			js->initial_avatar_hash =
+					jabber_calculate_data_hash(purple_imgstore_get_data(image),
+			purple_imgstore_get_size(image), "sha1");
+			purple_imgstore_unref(image);
+		} else {
+			js->initial_avatar_hash = NULL;
+		}
 		return;
+	}
 
 	if (js->vcard_timer) {
 		purple_timeout_remove(js->vcard_timer);


More information about the Commits mailing list