comparison src/plugins/plugin_xep_0092.py @ 928:73873e9b56f7

plugin XEP-0045: added user information to /whois text command
author Goffi <goffi@goffi.org>
date Mon, 24 Mar 2014 14:46:18 +0100
parents d609581bf74a
children c6d8fc63b1db
comparison
equal deleted inserted replaced
927:cd150dd947e3 928:73873e9b56f7
42 42
43 def __init__(self, host): 43 def __init__(self, host):
44 info(_("Plugin XEP_0092 initialization")) 44 info(_("Plugin XEP_0092 initialization"))
45 self.host = host 45 self.host = host
46 try: 46 try:
47 self.host.plugins[C.TEXT_CMDS].addWhoIsCb(self._whois, 100) 47 self.host.plugins[C.TEXT_CMDS].addWhoIsCb(self._whois, 50)
48 except KeyError: 48 except KeyError:
49 info(_("Text commands not available")) 49 info(_("Text commands not available"))
50 50
51 def getVersion(self, jid_, profile_key=C.PROF_KEY_NONE): 51 def getVersion(self, jid_, profile_key=C.PROF_KEY_NONE):
52 """ Ask version of the client that jid_ is running 52 """ Ask version of the client that jid_ is running
81 ret.append(None) 81 ret.append(None)
82 82
83 return tuple(ret) 83 return tuple(ret)
84 84
85 85
86 def _whois(self, whois_msg, target_jid, profile): 86 def _whois(self, whois_msg, mess_data, target_jid, profile):
87 """ Add software/OS information to whois """ 87 """ Add software/OS information to whois """
88 def versionCb(version_data): 88 def versionCb(version_data):
89 name, version, os = version_data 89 name, version, os = version_data
90 if name: 90 if name:
91 whois_msg.append(_("Client name: %s") % name) 91 whois_msg.append(_("Client name: %s") % name)