changeset 22927:25e4a0add118

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
author Stu Tomlinson <stu@nosnilmot.com>
date Tue, 13 May 2008 20:43:21 +0000
parents 4fa01df51fec
children 3ed8f8d074e4
files ChangeLog libpurple/protocols/msn/session.c libpurple/protocols/msnp9/session.c
diffstat 3 files changed, 35 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 13 18:56:11 2008 +0000
+++ b/ChangeLog	Tue May 13 20:43:21 2008 +0000
@@ -15,6 +15,9 @@
 	  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
--- a/libpurple/protocols/msn/session.c	Tue May 13 18:56:11 2008 +0000
+++ b/libpurple/protocols/msn/session.c	Tue May 13 20:43:21 2008 +0000
@@ -274,6 +274,7 @@
 {
 	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 @@
 						}
 					}
 
+					/* 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
--- a/libpurple/protocols/msnp9/session.c	Tue May 13 18:56:11 2008 +0000
+++ b/libpurple/protocols/msnp9/session.c	Tue May 13 20:43:21 2008 +0000
@@ -223,6 +223,7 @@
 {
 	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 @@
 
 					}
 
+					/* 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