Ticket #2616: fix_dup_amsg.diff

File fix_dup_amsg.diff, 1.8 kB (added by kanru, 4 months ago)
  • plugins_base/Commands.py

    old new  
    115115            _('Set your psm')) 
    116116        self.Slash.register('amsg', self.slash_amsg, 
    117117            _('Send a message to your opened conversations')) 
    118         self.Slash.register('amsg', self.slash_amsg, 
    119             _('Send a message to your opened conversations')) 
    120118        self.Slash.register('exec', self.slash_exec, 
    121119            _('Executes a system command and sends it to current conversation')) 
    122120        self.enabled = True 
     
    201199            slash_action.outputText(_('Error: missing text parameter')) 
    202200            slash_action.outputText(_('USAGE: /amsg <text>')) 
    203201 
    204     def slash_amsg(self, slash_action): 
    205         """Sends a message to every opened conversation""" 
    206         #Let's get parameters 
    207         params = slash_action.getParams() 
    208         if params : 
    209             #if there are parameters 
    210             for i, j in self.controller.conversationManager.conversations : 
    211                 j.sendMessage(params) 
    212         else: 
    213             #if there are not parameters 
    214             slash_action.outputText(_('Error: missing text parameter')) 
    215             slash_action.outputText(_('USAGE: /amsg <text>')) 
    216  
    217202    def slash_exec(self, slash_action): 
    218203        """Run shell command and send it to conversation""" 
    219204        params = slash_action.getParams() 
     
    238223        self.Slash.unregister('clear') 
    239224        self.Slash.unregister('psm') 
    240225        self.Slash.unregister('amsg') 
    241         self.Slash.unregister('amsg') 
    242226        self.Slash.unregister('exec') 
    243227        self.enabled = False 
    244228