changeset 25372:a8db457c421a

merge of '65e9577af05ac04edbde89c6216d06a7b828029a' and 'da4fface7b23fb7415d6ce2a72770ce5fbe006a0'
author Richard Laager <rlaager@wiktel.com>
date Mon, 26 Jan 2009 02:39:50 +0000
parents 0009541d4ec2 (diff) b3015da48886 (current diff)
children 3d456ca75ed9 fc8fd4fef166 bc8d1607f9b8
files
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/purple-url-handler	Sun Jan 25 20:51:41 2009 +0000
+++ b/libpurple/purple-url-handler	Mon Jan 26 02:39:50 2009 +0000
@@ -207,7 +207,11 @@
 
     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)