comparison src/plugins/plugin_misc_text_commands.py @ 1371:876c9fbd0b3d

plugin text command, XEP-0045, XEP-0048, XEP-0249: removed feedBackWrongContext which is no more usefull with new _contextValid method
author Goffi <goffi@goffi.org>
date Thu, 19 Mar 2015 14:30:08 +0100
parents 53c7678c27a6
children 85caf0a3abb3
comparison
equal deleted inserted replaced
1370:53c7678c27a6 1371:876c9fbd0b3d
268 else: 268 else:
269 _from = self.host.getJidNStream(profile)[0] 269 _from = self.host.getJidNStream(profile)[0]
270 270
271 self.host.bridge.newMessage(unicode(mess_data["to"]), message, C.MESS_TYPE_INFO, unicode(_from), {}, profile=profile) 271 self.host.bridge.newMessage(unicode(mess_data["to"]), message, C.MESS_TYPE_INFO, unicode(_from), {}, profile=profile)
272 272
273 def feedBackWrongContext(self, command, types, mess_data, profile):
274 """Give a generic message to the user when a command has been used in a wrong context.
275
276 @param command (string): the command name (without the slash)
277 @param types (string, list): the message types to which the command applies.
278 @param mess_data (dict): original message data
279 @param profile: %(doc_profile)s
280 """
281 if not isinstance(types, str):
282 types = _(' or ').join(types)
283 feedback = _("/%(command)s command only applies on %(type)s messages. ") % {'command': command, 'type': types}
284 self.host.plugins[C.TEXT_CMDS].feedBack(feedback + self.HELP_SUGGESTION, mess_data, profile)
285
286 def cmd_whois(self, mess_data, profile): 273 def cmd_whois(self, mess_data, profile):
287 """show information on entity""" 274 """show information on entity"""
288 log.debug("Catched whois command") 275 log.debug("Catched whois command")
289 276
290 entity = mess_data["unparsed"].strip() 277 entity = mess_data["unparsed"].strip()