# HG changeset patch # User Stu Tomlinson # Date 1279592837 0 # Node ID adef21420870e7fad6ff58fe48c6756eb93ebeb1 # Parent e874875a74a7273703bcb2282cc52a02f7061079 Some fixes to IRC handling in purple-url-handler, mainly to fix https://bugzilla.redhat.com/show_bug.cgi?id=614426 I probably broke it horribly in the process, but given that it wasn't even verifying the account was an IRC account before it can't be much more broken now. can it? diff -r e874875a74a7 -r adef21420870 libpurple/purple-url-handler --- a/libpurple/purple-url-handler Mon Jul 19 18:25:47 2010 +0000 +++ b/libpurple/purple-url-handler Tue Jul 20 02:27:17 2010 +0000 @@ -73,7 +73,8 @@ def findaccount(protocolname, accountname="", matcher=None): if matcher: for account in cpurple.PurpleAccountsGetAll(): - if accountname != "" and accountname != cpurple.PurpleAccountGetUsername(a): + if (protocolname != cpurple.PurpleAccountGetProtocolID(account)) or \ + (accountname != "" and accountname != cpurple.PurpleAccountGetUsername(account)): continue if matcher(account): bring_account_online(account) @@ -182,7 +183,7 @@ def irc(uri): protocol = "prpl-irc" - match = re.match(r"^irc:(//([^/]*)/)?([^?]*)(\?(.*))?", uri) + match = re.match(r"^irc:(//([^/]*))?/?([^?]*)(\?(.*))?", uri) if not match: print "Invalid irc URI: %s" % uri return @@ -207,7 +208,7 @@ def correct_server(account): username = cpurple.PurpleAccountGetUsername(account) - return ("@" in username) and (server == (username.split("@"))[1]) + return ((server == "") or ("@" in username) and (server == (username.split("@"))[1])) account = findaccount(protocol, matcher=correct_server)