changeset 23423:668b62240235

Make irc:// URLs use an account on the right server, not just the first IRC account configured. Fixes #3915.
author Will Thompson <will.thompson@collabora.co.uk>
date Thu, 03 Jul 2008 17:25:00 +0000
parents 0c66344d0ed5
children ab1f79d3ceeb
files libpurple/purple-url-handler
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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