*** Plucked rev 9115475787375850b563a1ec0b2007eaa463483e (qulogic@pidgin.im):

Mon, 14 Dec 2009 23:57:26 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 14 Dec 2009 23:57:26 +0000
changeset 29138
9e89f5ee9268
parent 29136
69e7d194a3db
child 29139
ddb8623ac924

*** Plucked rev 9115475787375850b563a1ec0b2007eaa463483e (qulogic@pidgin.im):
When adding users to an MSN chat, don't add them again if the same passport
is in the conversation. That is, ignore people logged in at more than one
location.

Fixes #7421.

ChangeLog file | annotate | diff | comparison | revisions
libpurple/protocols/msn/switchboard.c file | annotate | diff | comparison | revisions
--- a/ChangeLog	Mon Dec 14 06:50:33 2009 +0000
+++ b/ChangeLog	Mon Dec 14 23:57:26 2009 +0000
@@ -9,10 +9,12 @@
 	  Chinese characters (broken in 2.6.4)
 
 	MSN:
-	* File transfer requests will no longer cause a crash if you delete the file
-	  before the other side accepts.
-	* Recieved files will no longer hold an extra lock after completion, meaning
-	  they can be moved or deleted without complaints from your OS.
+	* File transfer requests will no longer cause a crash if you delete the
+	  file before the other side accepts.
+	* Recieved files will no longer hold an extra lock after completion,
+	  meaning they can be moved or deleted without complaints from your OS.
+	* Buddies who sign in from a second location will no longer cause an
+	  unnecessary chat window to open.
 
 	XMPP:
 	* Added support for the SCRAM-SHA-1 SASL mechanism.  This is only
--- a/libpurple/protocols/msn/switchboard.c	Mon Dec 14 06:50:33 2009 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Mon Dec 14 23:57:26 2009 +0000
@@ -222,13 +222,28 @@
 {
 	MsnCmdProc *cmdproc;
 	PurpleAccount *account;
+	char *semicolon;
+	char *passport;
 
 	g_return_if_fail(swboard != NULL);
 
 	cmdproc = swboard->cmdproc;
 	account = cmdproc->session->account;
 
-	swboard->users = g_list_prepend(swboard->users, g_strdup(user));
+	semicolon = strchr(user, ';');
+	/* We don't really care about the machine ID. */
+	if (semicolon)
+		passport = g_strndup(user, semicolon - user);
+	else
+		passport = g_strdup(user);
+
+	/* Don't add multiple endpoints to the conversation. */
+	if (g_list_find_custom(swboard->users, passport, (GCompareFunc)strcmp)) {
+		g_free(passport);
+		return;
+	}
+
+	swboard->users = g_list_prepend(swboard->users, passport);
 	swboard->current_users++;
 	swboard->empty = FALSE;
 

mercurial