libpurple/purple-url-handler

branch
release-2.x.y
changeset 38076
d0463f830578
parent 37446
ae398bcf92b9
child 38086
aca54766a8fa
equal deleted inserted replaced
38075:645f2bcf5517 38076:d0463f830578
222 channel = unquote_plus(target.split(",")[0]) 222 channel = unquote_plus(target.split(",")[0])
223 if channel[0] != "#": 223 if channel[0] != "#":
224 channel = "#" + channel 224 channel = "#" + channel
225 gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg")) 225 gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg"))
226 226
227 def msnim(uri):
228 protocol = "prpl-msn"
229 match = re.match(r"^msnim:([^?]*)(\?(.*))", uri)
230 if not match:
231 print("Invalid msnim URI: %s" % uri)
232 return
233
234 command = unquote_plus(match.group(1))
235 paramstring = match.group(3)
236 params = {}
237 if paramstring:
238 for param in paramstring.split("&"):
239 key, value = extendlist(param.split("=", 1), 2, "")
240 params[key] = unquote_plus(value)
241 screenname = params.get("contact", "")
242
243 account = findaccount(protocol)
244
245 if command.lower() == "chat":
246 goim(account, screenname)
247 elif command.lower() == "add":
248 addbuddy(account, screenname)
249
250 def myim(uri): 227 def myim(uri):
251 protocol = "prpl-myspace" 228 protocol = "prpl-myspace"
252 print "TODO: send uri: ", uri 229 print "TODO: send uri: ", uri
253 assert False, "Not implemented" 230 assert False, "Not implemented"
254 231
374 gg(uri) 351 gg(uri)
375 elif type == "icq": 352 elif type == "icq":
376 icq(uri) 353 icq(uri)
377 elif type == "irc": 354 elif type == "irc":
378 irc(uri) 355 irc(uri)
379 elif type == "msnim":
380 msnim(uri)
381 elif type == "myim": 356 elif type == "myim":
382 myim(uri) 357 myim(uri)
383 elif type == "sip": 358 elif type == "sip":
384 sip(uri) 359 sip(uri)
385 elif type == "xmpp": 360 elif type == "xmpp":

mercurial