# HG changeset patch # User Goffi # Date 1457355057 -3600 # Node ID 0a45bc8e7cf4e8b46e2b5dba736b71503319d441 # Parent be61c5c5e4742bd2c2fac55d21b30b279e70e479 plugin XEP-0045: fixed feedback for /kick /ban and /afficiliate commands which should not be public diff -r be61c5c5e474 -r 0a45bc8e7cf4 src/plugins/plugin_xep_0045.py --- a/src/plugins/plugin_xep_0045.py Mon Mar 07 13:49:13 2016 +0100 +++ b/src/plugins/plugin_xep_0045.py Mon Mar 07 13:50:57 2016 +0100 @@ -545,9 +545,10 @@ d = self.kick(nick, mess_data["to"], {} if len(options) == 1 else {'reason': options[1]}, profile) def cb(dummy): - mess_data['message'] = _('%s has been kicked') % nick + feedback_msg = _(u'You have kicked {}').format(nick) if len(options) > 1: - mess_data['message'] += _(' for the following reason: %s') % options[1] + feedback_msg += _(u' for the following reason: {}').format(options[1]) + self.host.plugins[C.TEXT_CMDS].feedBack(feedback_msg, mess_data, profile) return True d.addCallback(cb) return d @@ -573,9 +574,10 @@ d = self.ban(entity_jid, mess_data["to"], {} if len(options) == 1 else {'reason': options[1]}, profile) def cb(dummy): - mess_data['message'] = _('%s has been banned') % entity_jid + feedback_msg = _(u'You have banned {}').format(entity_jid) if len(options) > 1: - mess_data['message'] += _(' for the following reason: %s') % options[1] + feedback_msg += _(u' for the following reason: {}').format(options[1]) + self.host.plugins[C.TEXT_CMDS].feedBack(feedback_msg, mess_data, profile) return True d.addCallback(cb) return d @@ -611,7 +613,8 @@ d = self.affiliate(entity_jid, mess_data["to"], {'affiliation': affiliation}, profile) def cb(dummy): - mess_data['message'] = _('New affiliation for %(entity)s: %(affiliation)s') % {'entity': entity_jid, 'affiliation': affiliation} + feedback_msg = _(u'New affiliation for %(entity)s: %(affiliation)s').format(entity=entity_jid, affiliation=affiliation) + self.host.plugins[C.TEXT_CMDS].feedBack(feedback_msg, mess_data, profile) return True d.addCallback(cb) return d