From: <rl...@us...> - 2006-09-11 22:57:46
|
Revision: 17256 http://svn.sourceforge.net/gaim/?rev=17256&view=rev Author: rlaager Date: 2006-09-11 15:57:41 -0700 (Mon, 11 Sep 2006) Log Message: ----------- Sean requested case-insensitive matching on command, and noted that the plus sign wasn't being unescaped to a space. Both are fixed now. Modified Paths: -------------- trunk/libgaim/gaim-url-handler Modified: trunk/libgaim/gaim-url-handler =================================================================== --- trunk/libgaim/gaim-url-handler 2006-09-11 22:39:16 UTC (rev 17255) +++ trunk/libgaim/gaim-url-handler 2006-09-11 22:57:41 UTC (rev 17256) @@ -84,23 +84,23 @@ print "Invalid aim URI: %s" % uri return - command = urllib.unquote(match.group(2)) + command = urllib.unquote_plus(match.group(2)) paramstring = match.group(4) params = {} if paramstring: for param in paramstring.split("&"): key, value = extendlist(param.split("=", 1), 2, "") - params[key] = urllib.unquote(value) + params[key] = urllib.unquote_plus(value) accountname = params.get("account", "") screenname = params.get("screenname", "") account = findaccount(protocol, accountname) - if command == "goim": + if command.lower() == "goim": goim(account, screenname, params.get("message")) - elif command == "gochat": + elif command.lower() == "gochat": gochat(account, params) - elif command == "addbuddy": + elif command.lower() == "addbuddy": addbuddy(account, screenname, params.get("group", "")) def gg(uri): @@ -110,7 +110,7 @@ print "Invalid gg URI: %s" % uri return - screenname = urllib.unquote(match.group(1)) + screenname = urllib.unquote_plus(match.group(1)) account = findaccount(protocol) goim(account, screenname) @@ -124,7 +124,7 @@ print "Invalid irc URI: %s" % uri return - server = urllib.unquote(match.group(2)) or "" + server = urllib.unquote_plus(match.group(2)) or "" target = match.group(3) or "" query = match.group(5) or "" @@ -140,15 +140,15 @@ if paramstring: for param in paramstring.split("&"): key, value = extendlist(param.split("=", 1), 2, "") - params[key] = urllib.unquote(value) + params[key] = urllib.unquote_plus(value) account = findaccount(protocol) if (target != ""): if (isnick): - goim(account, urllib.unquote(target.split(",")[0]), params.get("msg")) + goim(account, urllib.unquote_plus(target.split(",")[0]), params.get("msg")) else: - channel = urllib.unquote(target.split(",")[0]) + channel = urllib.unquote_plus(target.split(",")[0]) if channel[0] != "#": channel = "#" + channel gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg")) @@ -160,20 +160,20 @@ print "Invalid msnim URI: %s" % uri return - command = urllib.unquote(match.group(1)) + command = urllib.unquote_plus(match.group(1)) paramstring = match.group(3) params = {} if paramstring: for param in paramstring.split("&"): key, value = extendlist(param.split("=", 1), 2, "") - params[key] = urllib.unquote(value) + params[key] = urllib.unquote_plus(value) screenname = params.get("contact", "") account = findaccount(protocol) - if command == "chat": + if command.lower() == "chat": goim(account, screenname) - elif command == "add": + elif command.lower() == "add": addbuddy(account, screenname) def sip(uri): @@ -183,7 +183,7 @@ print "Invalid sip URI: %s" % uri return - screenname = urllib.unquote(match.group(1)) + screenname = urllib.unquote_plus(match.group(1)) account = findaccount(protocol) goim(account, screenname) @@ -194,24 +194,24 @@ print "Invalid xmpp URI: %s" % uri return - accountname = urllib.unquote(match.group(2)) or "" - screenname = urllib.unquote(match.group(4)) - command = urllib.unquote(match.group(6)) + 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) params = {} if paramstring: for param in paramstring.split(";"): key, value = extendlist(param.split("=", 1), 2, "") - params[key] = urllib.unquote(value) + params[key] = urllib.unquote_plus(value) account = findaccount(protocol, accountname) - if command == "message": + if command.lower() == "message": goim(account, screenname, params.get("body")) - elif command == "join": + elif command.lower() == "join": room, server = screenname.split("@") gochat(account, {"room": room, "server": server}) - elif command == "roster": + elif command.lower() == "roster": addbuddy(account, screenname, params.get("group", ""), params.get("name", "")) else: goim(account, screenname) @@ -223,22 +223,22 @@ print "Invalid ymsgr URI: %s" % uri return - command = urllib.unquote(match.group(1)) - screenname = urllib.unquote(match.group(3)) + command = urllib.unquote_plus(match.group(1)) + screenname = urllib.unquote_plus(match.group(3)) paramstring = match.group(5) params = {} if paramstring: for param in paramstring.split("&"): key, value = extendlist(param.split("=", 1), 2, "") - params[key] = urllib.unquote(value) + params[key] = urllib.unquote_plus(value) account = findaccount(protocol) - if command == "sendIM": + if command.lower() == "sendIM": goim(account, screenname, params.get("m")) - elif command == "chat": + elif command.lower() == "chat": gochat(account, {"room": screenname}) - elif command == "addfriend": + elif command.lower() == "addfriend": addbuddy(account, screenname) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-09-12 09:04:13
|
Revision: 17260 http://svn.sourceforge.net/gaim/?rev=17260&view=rev Author: rlaager Date: 2006-09-12 02:04:04 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Angel Marin pointed out this mistake. Modified Paths: -------------- trunk/libgaim/gaim-url-handler Modified: trunk/libgaim/gaim-url-handler =================================================================== --- trunk/libgaim/gaim-url-handler 2006-09-12 07:05:27 UTC (rev 17259) +++ trunk/libgaim/gaim-url-handler 2006-09-12 09:04:04 UTC (rev 17260) @@ -234,7 +234,7 @@ account = findaccount(protocol) - if command.lower() == "sendIM": + if command.lower() == "sendim": goim(account, screenname, params.get("m")) elif command.lower() == "chat": gochat(account, {"room": screenname}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |