# HG changeset patch # User Richard Laager # Date 1163827531 0 # Node ID 5d71039b20eb0e3c14f6a7c2fa462017c7f9ddc9 # Parent 58849b67f00d9110188b1bb7cd7a36ce08a235e7 [gaim-migrate @ 17773] Fixes Debian Bug #398969 Properly handle the following cases: xmpp:... URLs without the // xmpp URLs with no account xmpp URLs with no command committer: Tailor Script diff -r 58849b67f00d -r 5d71039b20eb libgaim/gaim-url-handler --- a/libgaim/gaim-url-handler Sat Nov 18 04:03:48 2006 +0000 +++ b/libgaim/gaim-url-handler Sat Nov 18 05:25:31 2006 +0000 @@ -189,15 +189,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 - accountname = urllib.unquote_plus(match.group(2)) or "" - screenname = urllib.unquote_plus(match.group(4)) - command = urllib.unquote_plus(match.group(6)) - paramstring = match.group(8) + tmp = match.group(3) + if (tmp): + accountname = urllib.unquote_plus(tmp) + else: + accountname = "" + + screenname = urllib.unquote_plus(match.group(5)) + + tmp = match.group(7) + if (tmp): + command = urllib.unquote_plus(tmp) + else: + command = "" + + paramstring = match.group(9) params = {} if paramstring: for param in paramstring.split(";"):