# HG changeset patch # User Elliott Sales de Andrade # Date 1260835046 0 # Node ID 19be6fe515ca960ccee9638e7e798ca5aefd6f18 # Parent 139aa186e8ccf9c33740d5713c0944df3cd988a2 *** 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. diff -r 139aa186e8cc -r 19be6fe515ca ChangeLog --- 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 diff -r 139aa186e8cc -r 19be6fe515ca libpurple/protocols/msn/switchboard.c --- 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;