Mercurial > libervia-backend
comparison src/plugins/plugin_misc_text_commands.py @ 698:d731ae066158
core: sendMessage's options parameter has been renamed to extra to be consistent with newMessage
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 13 Nov 2013 13:58:10 +0100 |
parents | 0c84fb112d70 |
children | bfabeedbf32e |
comparison
equal
deleted
inserted
replaced
697:0c84fb112d70 | 698:d731ae066158 |
---|---|
208 return False | 208 return False |
209 | 209 |
210 def cmd_whois(self, mess_data, profile): | 210 def cmd_whois(self, mess_data, profile): |
211 """show informations on entity""" | 211 """show informations on entity""" |
212 debug("Catched whois command") | 212 debug("Catched whois command") |
213 | 213 |
214 entity = mess_data["unparsed"].strip() | 214 entity = mess_data["unparsed"].strip() |
215 | 215 |
216 if mess_data['type'] == "groupchat": | 216 if mess_data['type'] == "groupchat": |
217 room = mess_data["to"] | 217 room = mess_data["to"] |
218 if self.host.plugins["XEP-0045"].isNickInRoom(room, entity, profile): | 218 if self.host.plugins["XEP-0045"].isNickInRoom(room, entity, profile): |
219 entity = u"%s/%s" % (room, entity) | 219 entity = u"%s/%s" % (room, entity) |
220 | 220 |
221 if not entity: | 221 if not entity: |
222 target_jid = mess_data["to"] | 222 target_jid = mess_data["to"] |
223 else: | 223 else: |
224 try: | 224 try: |
225 target_jid = jid.JID(entity) | 225 target_jid = jid.JID(entity) |
226 if not target_jid.user or not target_jid.host: | 226 if not target_jid.user or not target_jid.host: |
227 raise jid.InvalidFormat | 227 raise jid.InvalidFormat |
228 except (jid.InvalidFormat, RuntimeError): | 228 except (jid.InvalidFormat, RuntimeError): |
229 self._feedBack(_("Invalid jid, can't whois"), mess_data, profile) | 229 self._feedBack(_("Invalid jid, can't whois"), mess_data, profile) |
230 return False | 230 return False |
231 | 231 |
232 whois_msg = [_(u"whois for %(jid)s") % {'jid': target_jid}] | 232 whois_msg = [_(u"whois for %(jid)s") % {'jid': target_jid}] |
233 #TODO: add informations here (client version, vcard, etc) | 233 #TODO: add informations here (client version, vcard, etc) |
234 | 234 |
235 self._feedBack(u"\n".join(whois_msg), mess_data, profile) | 235 self._feedBack(u"\n".join(whois_msg), mess_data, profile) |
236 | 236 |
237 return False | 237 return False |
238 | 238 |
239 def cmd_help(self, mess_data, profile): | 239 def cmd_help(self, mess_data, profile): |