Mercurial > pidgin
comparison libpurple/purple-url-handler @ 23421:668b62240235
Make irc:// URLs use an account on the right server, not just the first IRC
account configured. Fixes #3915.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Thu, 03 Jul 2008 17:25:00 +0000 |
parents | 0c66344d0ed5 |
children | ab1f79d3ceeb |
comparison
equal
deleted
inserted
replaced
23420:0c66344d0ed5 | 23421:668b62240235 |
---|---|
203 if paramstring: | 203 if paramstring: |
204 for param in paramstring.split("&"): | 204 for param in paramstring.split("&"): |
205 key, value = extendlist(param.split("=", 1), 2, "") | 205 key, value = extendlist(param.split("=", 1), 2, "") |
206 params[key] = urllib.unquote_plus(value) | 206 params[key] = urllib.unquote_plus(value) |
207 | 207 |
208 account = findaccount(protocol) | 208 def correct_server(account): |
209 username = cpurple.PurpleAccountGetUsername(account) | |
210 return (server == (username.split("@"))[1]) | |
211 | |
212 account = findaccount(protocol, matcher=correct_server) | |
209 | 213 |
210 if (target != ""): | 214 if (target != ""): |
211 if (isnick): | 215 if (isnick): |
212 goim(account, urllib.unquote_plus(target.split(",")[0]), params.get("msg")) | 216 goim(account, urllib.unquote_plus(target.split(",")[0]), params.get("msg")) |
213 else: | 217 else: |
214 channel = urllib.unquote_plus(target.split(",")[0]) | 218 channel = urllib.unquote_plus(target.split(",")[0]) |
215 if channel[0] != "#": | 219 if channel[0] != "#": |
216 channel = "#" + channel | 220 channel = "#" + channel |
217 gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg")) | 221 gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg")) |
218 | 222 |