comparison src/plugins/plugin_xep_0048.py @ 1002:291eb8216f6e

plugins TEXT-COMMANDS, XEP-0045, XEP-0048, XEP-0249: - give a feedback instead of sending the message when the command is invalid or used in a wrong context - add command /join for XEP-0249
author souliane <souliane@mailoo.org>
date Wed, 30 Apr 2014 16:34:09 +0200
parents 301b342c697a
children 876c9fbd0b3d
comparison
equal deleted inserted replaced
1001:eb3601ff73bc 1002:291eb8216f6e
426 log.debug("Catched bookmark command") 426 log.debug("Catched bookmark command")
427 client = self.host.getClient(profile) 427 client = self.host.getClient(profile)
428 txt_cmd = self.host.plugins[C.TEXT_CMDS] 428 txt_cmd = self.host.plugins[C.TEXT_CMDS]
429 429
430 if mess_data['type'] != "groupchat": 430 if mess_data['type'] != "groupchat":
431 #/bookmark command does nothing if we are not on a group chat 431 self.host.plugins[C.TEXT_CMDS].feedBackWrongContext('bookmark', 'groupchat', mess_data, profile)
432 log.info("Ignoring /bookmark command on a non groupchat message") 432 return False
433 return True
434 433
435 options = mess_data["unparsed"].strip().split() 434 options = mess_data["unparsed"].strip().split()
436 if options and options[0] not in ('autojoin', 'remove'): 435 if options and options[0] not in ('autojoin', 'remove'):
437 txt_cmd.feedBack(_("Bad arguments"), mess_data, profile) 436 txt_cmd.feedBack(_("Bad arguments"), mess_data, profile)
438 return False 437 return False