pidgin: b7b0cdb5: Make MSN buddy list synchronization more...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Tue May 13 16:45:48 EDT 2008


-----------------------------------------------------------------
Revision: b7b0cdb54636b394fa68e17d13af49e19e186eb1
Ancestor: eb525fc0d3f2a7f9440a85781c0fcdda9aafe6b5
Author: nosnilmot at pidgin.im
Date: 2008-05-13T20:43:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b7b0cdb54636b394fa68e17d13af49e19e186eb1

Modified files:
        ChangeLog libpurple/protocols/msn/session.c
        libpurple/protocols/msnp9/session.c

ChangeLog: 

Make MSN buddy list synchronization more forgiving, only ask about
buddies who appear to have disappeared completely from the server list
instead of those that have simply moved groups.

References #945, #1184


-------------- next part --------------
============================================================
--- ChangeLog	0e1391ad1734f8bde42a1862e8e7f41e2f5c8fb6
+++ ChangeLog	23bb12dc62b40e9af81b77178e21a4118b670be6
@@ -15,6 +15,9 @@ version 2.x.x:
 	  libnm-glib.  Hopefully it's stable now.  It will now compile by
 	  default if you have D-Bus support and NetworkManager.h. (Elliott
 	  Sales de Andrade)
+	* Make MSN buddy list synchronization more forgiving, only ask about
+	  buddies who appear to have disappeared completely from the server list
+	  instead of those that have simply moved groups.
 
 	Pidgin:
 	* The typing notification in the conversation history can be disabled or
============================================================
--- libpurple/protocols/msn/session.c	76ab4406cd30437a247d39d760384b8a1a6c2dfe
+++ libpurple/protocols/msn/session.c	11baad00af42bc05e92d5c687db8233e036f4085
@@ -274,6 +274,7 @@ msn_session_sync_users(MsnSession *sessi
 {
 	PurpleBlistNode *gnode, *cnode, *bnode;
 	PurpleConnection *gc = purple_account_get_connection(session->account);
+	GList *to_remove = NULL;
 
 	g_return_if_fail(gc != NULL);
 
@@ -316,16 +317,28 @@ msn_session_sync_users(MsnSession *sessi
 						}
 					}
 
+					/* We don't care if they're in a different group, as long as they're on the
+					 * list somewhere. If we check for the group, we cause pain, agony and
+					 * suffering for people who decide to re-arrange their buddy list elsewhere.
+					 */
 					if (!found)
 					{
-						/* The user was not on the server list or not in that group
-						 * on the server list */
-						msn_show_sync_issue(session, purple_buddy_get_name(b), group_name);
+						if ((remote_user == NULL) || !(remote_user->list_op & MSN_LIST_FL_OP)) {
+							/* The user is not on the server list */
+							msn_show_sync_issue(session, purple_buddy_get_name(b), group_name);
+						} else {
+							/* The user is not in that group on the server list */
+							to_remove = g_list_prepend(to_remove, b);
+						}
 					}
 				}
 			}
 		}
 	}
+
+	if (to_remove != NULL) {
+		g_list_foreach(to_remove, (GFunc)purple_blist_remove_buddy, NULL);
+	}
 }
 
 void
============================================================
--- libpurple/protocols/msnp9/session.c	a9baf3c5fd8f14a419e50e988375cef3db20bd93
+++ libpurple/protocols/msnp9/session.c	771431314d4fafdad343b43e71e5be72b97cf2a8
@@ -223,6 +223,7 @@ msn_session_sync_users(MsnSession *sessi
 {
 	PurpleBlistNode *gnode, *cnode, *bnode;
 	PurpleConnection *gc = purple_account_get_connection(session->account);
+	GList *to_remove = NULL;
 
 	g_return_if_fail(gc != NULL);
 
@@ -268,16 +269,28 @@ msn_session_sync_users(MsnSession *sessi
 
 					}
 
+					/* We don't care if they're in a different group, as long as they're on the
+					 * list somewhere. If we check for the group, we cause pain, agony and
+					 * suffering for people who decide to re-arrange their buddy list elsewhere.
+					 */
 					if (!found)
 					{
-						/* The user was not on the server list or not in that group
-						 * on the server list */
-						msn_show_sync_issue(session, purple_buddy_get_name(b), group_name);
+						if ((remote_user == NULL) || !(remote_user->list_op & MSN_LIST_FL_OP)) {
+							/* The user is not on the server list */
+							msn_show_sync_issue(session, purple_buddy_get_name(b), group_name);
+						} else {
+							/* The user is not in that group on the server list */
+							to_remove = g_list_prepend(to_remove, b);
+						}
 					}
 				}
 			}
 		}
 	}
+
+	if (to_remove != NULL) {
+		g_list_foreach(to_remove, (GFunc)purple_blist_remove_buddy, NULL);
+	}
 }
 
 void


More information about the Commits mailing list