# HG changeset patch # User Richard Laager # Date 1177617316 0 # Node ID 27dfbca8dd405818d204561bc9141001ba2a61bc # Parent e4067cd1d2b2d9dcfacd2ff7423ba2787d4bc29f Ticket #320 from ltm "The simplest form of XMPP URIs are handled incorrectly by purple-url-handler. The URI xmpp:romeo@montague.net specifies a screenname (recipient) and no accountname (sender). The purple-url-handler script will, however, assume no screenname and treat romeo@montague.net as the accountname." "The attached patch fixes the issue and makes some minor cleanup in the aim and icq handlers." diff -r e4067cd1d2b2 -r 27dfbca8dd40 libpurple/purple-url-handler --- a/libpurple/purple-url-handler Thu Apr 26 18:10:06 2007 +0000 +++ b/libpurple/purple-url-handler Thu Apr 26 19:55:16 2007 +0000 @@ -92,13 +92,13 @@ def aim(uri): protocol = "prpl-aim" - match = re.match(r"^(aim):([^?]*)(\?(.*))", uri) + match = re.match(r"^aim:([^?]*)(\?(.*))", uri) if not match: print "Invalid aim URI: %s" % uri return - command = urllib.unquote_plus(match.group(2)) - paramstring = match.group(4) + command = urllib.unquote_plus(match.group(1)) + paramstring = match.group(3) params = {} if paramstring: for param in paramstring.split("&"): @@ -129,13 +129,13 @@ def icq(uri): protocol = "prpl-icq" - match = re.match(r"^(icq):([^?]*)(\?(.*))", uri) + match = re.match(r"^icq:([^?]*)(\?(.*))", uri) if not match: - print "Invalid aim URI: %s" % uri + print "Invalid icq URI: %s" % uri return - command = urllib.unquote_plus(match.group(2)) - paramstring = match.group(4) + command = urllib.unquote_plus(match.group(1)) + paramstring = match.group(3) params = {} if paramstring: for param in paramstring.split("&"): @@ -225,26 +225,26 @@ def xmpp(uri): protocol = "prpl-jabber" - match = re.match(r"^xmpp:((//)?([^/?#]*))?(/?([^?#]*))(\?([^;#]*)(;([^#]*))?)?(#(.*))?", uri) + match = re.match(r"^xmpp:(//([^/?#]*)/?)?([^?#]*)(\?([^;#]*)(;([^#]*))?)?(#(.*))?", uri) if not match: print "Invalid xmpp URI: %s" % uri return - tmp = match.group(3) + tmp = match.group(2) if (tmp): accountname = urllib.unquote_plus(tmp) else: accountname = "" - screenname = urllib.unquote_plus(match.group(5)) + screenname = urllib.unquote_plus(match.group(3)) - tmp = match.group(7) + tmp = match.group(5) if (tmp): command = urllib.unquote_plus(tmp) else: command = "" - paramstring = match.group(9) + paramstring = match.group(7) params = {} if paramstring: for param in paramstring.split(";"):