pidgin: f6542fe5: Make irc:// URLs use an account on the r.

resiak at pidgin.im resiak at pidgin.im
Thu Jul 3 13:42:17 EDT 2008


-----------------------------------------------------------------
Revision: f6542fe5b5a1127f2dea7b80e55a6421a83d4d20
Ancestor: 5bf806cffab0dd258fb031a859123fdbd5f63198
Author: resiak at pidgin.im
Date: 2008-07-03T17:25:00
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f6542fe5b5a1127f2dea7b80e55a6421a83d4d20

Modified files:
        libpurple/purple-url-handler

ChangeLog: 

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

-------------- next part --------------
============================================================
--- libpurple/purple-url-handler	fed3e84d2b12137899fb4a2218792323b231ddfa
+++ libpurple/purple-url-handler	0eb63ff633cf9bdf8e7dcc0178a7c8658012f7e1
@@ -205,12 +205,16 @@ def irc(uri):
             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


More information about the Commits mailing list