pidgin: b988b4d5: Don't call aim_src_clientready() until w...

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Oct 15 19:46:24 EDT 2009


-----------------------------------------------------------------
Revision: b988b4d536524e124366b7da01b0e8706ac0a099
Ancestor: 0d319bbd23fdd7e6cf2065b21e92612657c6e8cb
Author: markdoliner at pidgin.im
Date: 2009-10-15T23:42:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b988b4d536524e124366b7da01b0e8706ac0a099

Modified files:
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/oscar/oscar.h

ChangeLog: 

Don't call aim_src_clientready() until we have activated our feedbag
(and also until after we have our bos rights, but I'm not sure if that
matters).  This fixes the bug where AIM block lists recently stopped
working.  I imagine AIM permit lists were also broken, as well as the
three ICQ privacy lists.

It's conceivable that this will also fix the bug where your contact
list is sometimes empty, but I have no evidence to support that either
way.

This change will be in the next release of Pidgin, 2.6.3, which will
probably be released within the next week.

Thanks to AOL for telling me what we were doing wrong.

Fixes #10489
Fixes #10499
Fixes #10509
Refs #10411

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	c0ac247833af9a49df59ca3c58ceab5ce6263366
+++ libpurple/protocols/oscar/oscar.c	42bbc1a4ff0b9b66e5487d7171b3cba95b6b9bd5
@@ -3909,12 +3909,8 @@ static int purple_bosrights(OscarData *o
 	od->rights.maxpermits = (guint)maxpermits;
 	od->rights.maxdenies = (guint)maxdenies;
 
-	purple_connection_set_state(gc, PURPLE_CONNECTED);
-
 	purple_debug_info("oscar", "buddy list loaded\n");
 
-	aim_srv_clientready(od, conn);
-
 	if (purple_account_get_user_info(account) != NULL)
 		serv_set_info(gc, purple_account_get_user_info(account));
 
@@ -3957,6 +3953,22 @@ static int purple_bosrights(OscarData *o
 	aim_srv_requestnew(od, SNAC_FAMILY_ALERT);
 	aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV);
 
+	od->bos.have_rights = TRUE;
+
+	/*
+	 * If we've already received our feedbag data then we're not waiting on
+	 * anything else, so send the server clientready.
+	 *
+	 * Normally we get bos rights before we get our feedbag data, so this
+	 * rarely (never?) happens.  And I'm not sure it actually matters if we
+	 * wait for bos rights before calling clientready.  But it seems safer
+	 * to do it this way.
+	 */
+	if (od->ssi.received_data) {
+		aim_srv_clientready(od, conn);
+		purple_connection_set_state(gc, PURPLE_CONNECTED);
+	}
+
 	return 1;
 }
 
@@ -5396,6 +5408,15 @@ static int purple_ssi_parselist(OscarDat
 	oscar_set_icon(gc, img);
 	purple_imgstore_unref(img);
 
+	/*
+	 * If we've already received our bos rights then we're not waiting on
+	 * anything else, so send the server clientready.
+	 */
+	if (od->bos.have_rights) {
+		aim_srv_clientready(od, conn);
+		purple_connection_set_state(gc, PURPLE_CONNECTED);
+	}
+
 	return 1;
 }
 
============================================================
--- libpurple/protocols/oscar/oscar.h	36572bc731fbb1f3c3ddd1c08fa112f8f8df61c3
+++ libpurple/protocols/oscar/oscar.h	7479032fbbad999fb11c429327d3d72d9e39fe6d
@@ -535,6 +535,10 @@ struct _OscarData
 		struct aim_userinfo_s *userinfo;
 	} locate;
 
+	struct {
+		gboolean have_rights;
+	} bos;
+
 	/* Server-stored information (ssi) */
 	struct {
 		gboolean received_data;


More information about the Commits mailing list