cpw.qulogic.msn: 075bff91: A patch from felipec to stop requesting ...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jun 23 01:56:30 EDT 2008


-----------------------------------------------------------------
Revision: 075bff91d9cbcfd6f59c270802c5bffeb98c3b50
Ancestor: e2a8133c3648a1a37576ade5e67c46730885e40e
Author: qulogic at pidgin.im
Date: 2008-06-22T22:59:50
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/075bff91d9cbcfd6f59c270802c5bffeb98c3b50

Modified files:
        libpurple/protocols/msn/slp.c

ChangeLog: 

A patch from felipec to stop requesting the MSN buddy icon when the 
object is changed in the middle of the request or the buddy has gone 
offline.

References #5377.
And http://pidgin.im/pipermail/devel/2008-June/006133.html
And http://pidgin.im/pipermail/devel/2008-June/006134.html

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	af32d7e2fbff833dd05a1408d434ac23302f6f78
+++ libpurple/protocols/msn/slp.c	bf3995143d8f9f3306c8a844a3ee77a5a17fc41d
@@ -1067,6 +1067,21 @@ static void
 }
 
 static void
+next_buddy_request(MsnUserList *userlist)
+{
+	/* Free one window slot */
+	userlist->buddy_icon_window++;
+
+#ifdef MSN_DEBUG_UD
+	purple_debug_info("msn", "request_user_display(): buddy_icon_window++ yields =%d\n",
+		userlist->buddy_icon_window);
+#endif
+
+	/* Request the next one */
+	msn_release_buddy_icon_request(userlist);
+}
+
+static void
 request_user_display(MsnUser *user)
 {
 	PurpleAccount *account;
@@ -1082,6 +1097,19 @@ request_user_display(MsnUser *user)
 
 	obj = msn_user_get_object(user);
 
+	/* Changed while in the queue. */
+	if (obj == NULL) {
+		purple_buddy_icons_set_for_user(account, user->passport, NULL, 0, NULL);
+		next_buddy_request(session->userlist);
+		return;
+	}
+
+	/* The user went offline. */
+	if (user->status == NULL) {
+		next_buddy_request(session->userlist);
+		return;
+	}
+
 	info = msn_object_get_sha1(obj);
 
 	if (g_ascii_strcasecmp(user->passport,
@@ -1111,14 +1139,7 @@ request_user_display(MsnUser *user)
 
 		purple_buddy_icons_set_for_user(account, user->passport, g_memdup(data, len), len, info);
 
-		/* Free one window slot */
-		session->userlist->buddy_icon_window++;
-
-#ifdef MSN_DEBUG_UD
-		purple_debug_info("msn", "request_user_display(): buddy_icon_window++ yields =%d\n",
-						session->userlist->buddy_icon_window);
-#endif
-
-		msn_release_buddy_icon_request(session->userlist);
+		next_buddy_request(session->userlist);
 	}
 }
+


More information about the Commits mailing list