comparison libpurple/purple-url-handler @ 31389:380314aa5c1b

Fix some issues with purple-url-handler. The findaccount function was failing because the call to cpurple.PurpleAccountGetProtocolId used the wrong case for the function name. The IRC handler could also incorrectly called unquote_plus with a None value. I didn't really check the rest of the IRC handler, though. It might be broken in other ways. Reported by PotterT|VF in the IRC channel.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 16 Mar 2011 04:59:16 +0000
parents adef21420870
children
comparison
equal deleted inserted replaced
31388:0efc07144f2f 31389:380314aa5c1b
71 purple.PurpleAccountConnect(account) 71 purple.PurpleAccountConnect(account)
72 72
73 def findaccount(protocolname, accountname="", matcher=None): 73 def findaccount(protocolname, accountname="", matcher=None):
74 if matcher: 74 if matcher:
75 for account in cpurple.PurpleAccountsGetAll(): 75 for account in cpurple.PurpleAccountsGetAll():
76 if (protocolname != cpurple.PurpleAccountGetProtocolID(account)) or \ 76 if (protocolname != cpurple.PurpleAccountGetProtocolId(account)) or \
77 (accountname != "" and accountname != cpurple.PurpleAccountGetUsername(account)): 77 (accountname != "" and accountname != cpurple.PurpleAccountGetUsername(account)):
78 continue 78 continue
79 if matcher(account): 79 if matcher(account):
80 bring_account_online(account) 80 bring_account_online(account)
81 return account 81 return account
186 match = re.match(r"^irc:(//([^/]*))?/?([^?]*)(\?(.*))?", uri) 186 match = re.match(r"^irc:(//([^/]*))?/?([^?]*)(\?(.*))?", uri)
187 if not match: 187 if not match:
188 print "Invalid irc URI: %s" % uri 188 print "Invalid irc URI: %s" % uri
189 return 189 return
190 190
191 server = urllib.unquote_plus(match.group(2)) or "" 191 server = urllib.unquote_plus(match.group(2) or "")
192 target = match.group(3) or "" 192 target = match.group(3) or ""
193 query = match.group(5) or "" 193 query = match.group(5) or ""
194 194
195 modifiers = {} 195 modifiers = {}
196 if target: 196 if target: