Philipp Hörist pushed to branch master at gajim / python-nbxmpp

Commits:

1 changed file:

Changes:

  • nbxmpp/dispatcher_nb.py
    ... ... @@ -578,11 +578,12 @@ class XMPPDispatcher(PlugIn):
    578 578
                 # add timestamp to message stanza in queue
    
    579 579
                 if (stanza.getName() == 'message' and
    
    580 580
                         stanza.getType() in ('chat', 'groupchat')):
    
    581
    -                our_jid = stanza.getAttr('from')
    
    582 581
                     timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
    
    583
    -                stanza.addChild('delay', namespace=NS_DELAY2,
    
    584
    -                                attrs={'from': our_jid or 'Gajim',
    
    585
    -                                       'stamp': timestamp})
    
    582
    +                attrs = {'stamp': timestamp}
    
    583
    +                if stanza.getType() != 'groupchat':
    
    584
    +                    # Dont leak our JID to Groupchats
    
    585
    +                    attrs['from'] = stanza.getAttr('from')
    
    586
    +                stanza.addChild('delay', namespace=NS_DELAY2, attrs=attrs)
    
    586 587
                 self.sm.uqueue.append(stanza)
    
    587 588
                 self.sm.out_h += 1
    
    588 589