Make irc:// URLs use an account on the right server, not just the first IRC

Thu, 03 Jul 2008 17:25:00 +0000

author
Will Thompson <resiak@pidgin.im>
date
Thu, 03 Jul 2008 17:25:00 +0000
changeset 23564
9ccc8c1ddc6b
parent 23563
04877760aaf1
child 23565
3f1a5a63a051

Make irc:// URLs use an account on the right server, not just the first IRC
account configured. Fixes #3915.

libpurple/purple-url-handler file | annotate | diff | comparison | revisions
--- a/libpurple/purple-url-handler	Thu Jul 03 17:19:46 2008 +0000
+++ b/libpurple/purple-url-handler	Thu Jul 03 17:25:00 2008 +0000
@@ -205,12 +205,16 @@
             key, value = extendlist(param.split("=", 1), 2, "")
             params[key] = urllib.unquote_plus(value)
 
-    account = findaccount(protocol)
+    def correct_server(account):
+        username = cpurple.PurpleAccountGetUsername(account)
+        return (server == (username.split("@"))[1])
+
+    account = findaccount(protocol, matcher=correct_server)
 
     if (target != ""):
         if (isnick):
             goim(account, urllib.unquote_plus(target.split(",")[0]), params.get("msg"))
-	else:
+        else:
             channel = urllib.unquote_plus(target.split(",")[0])
             if channel[0] != "#":
                 channel = "#" + channel

mercurial