comparison libpurple/purple-url-handler @ 25371:0009541d4ec2

In the course of looking at purple-url-handler to compose a response to a post on devel@pidgin.im, I found and fixed a bug where handling an IRC URL will fail if you have any accounts with no user_split in the list of accounts before the IRC account in question.
author Richard Laager <rlaager@wiktel.com>
date Mon, 26 Jan 2009 02:35:25 +0000
parents c260fe3ac5c8
children 971b89243a20
comparison
equal deleted inserted replaced
25369:681e58ea3a9b 25371:0009541d4ec2
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 def correct_server(account): 208 def correct_server(account):
209 username = cpurple.PurpleAccountGetUsername(account) 209 username = cpurple.PurpleAccountGetUsername(account)
210 return (server == (username.split("@"))[1]) 210 user_split = (username.split("@"))
211 # Not all accounts have a split, so append an empty string so the
212 # [1] doesn't throw an IndexError.
213 user_split.append("")
214 return (server == user_split[1])
211 215
212 account = findaccount(protocol, matcher=correct_server) 216 account = findaccount(protocol, matcher=correct_server)
213 217
214 if (target != ""): 218 if (target != ""):
215 if (isnick): 219 if (isnick):