From: <rl...@us...> - 2006-11-18 05:25:33
|
Revision: 17773 http://svn.sourceforge.net/gaim/?rev=17773&view=rev Author: rlaager Date: 2006-11-17 21:25:31 -0800 (Fri, 17 Nov 2006) Log Message: ----------- Fixes Debian Bug #398969 Properly handle the following cases: xmpp:... URLs without the // xmpp URLs with no account xmpp URLs with no command Modified Paths: -------------- trunk/libgaim/gaim-url-handler Modified: trunk/libgaim/gaim-url-handler =================================================================== --- trunk/libgaim/gaim-url-handler 2006-11-18 04:03:48 UTC (rev 17772) +++ trunk/libgaim/gaim-url-handler 2006-11-18 05:25:31 UTC (rev 17773) @@ -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(";"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |