pidgin: 65e9577a: In the course of looking at purple-url-h...

rlaager at pidgin.im rlaager at pidgin.im
Sun Jan 25 21:40:22 EST 2009


-----------------------------------------------------------------
Revision: 65e9577af05ac04edbde89c6216d06a7b828029a
Ancestor: b20c44775e2aa1c5bc5e36f7f94adafc5c67b3fd
Author: rlaager at pidgin.im
Date: 2009-01-26T02:35:25
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/65e9577af05ac04edbde89c6216d06a7b828029a

Modified files:
        libpurple/purple-url-handler

ChangeLog: 

In the course of looking at purple-url-handler to compose a response to a
post on devel at pidgin.im, I found and fixed a bug where handling an IRC URL
will fail if you have any accounts with no user_split in the list of accounts
before the IRC account in question.

-------------- next part --------------
============================================================
--- libpurple/purple-url-handler	99b3f5593351d9f745821dbdc6e349f1b2cbdcad
+++ libpurple/purple-url-handler	42f2b964ae28c613415d9b08a41d176c02ce8d0f
@@ -207,7 +207,11 @@ def irc(uri):
 
     def correct_server(account):
         username = cpurple.PurpleAccountGetUsername(account)
-        return (server == (username.split("@"))[1])
+        user_split = (username.split("@"))
+        # Not all accounts have a split, so append an empty string so the
+        # [1] doesn't throw an IndexError.
+        user_split.append("")
+        return (server == user_split[1])
 
     account = findaccount(protocol, matcher=correct_server)
 


More information about the Commits mailing list