Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
f6226140 by Philipp Hörist at 2017-05-30T16:51:35+02:00
Dont leak JID to groupchats on resending messages
- - - - -
1 changed file:
- nbxmpp/dispatcher_nb.py
Changes:
=====================================
nbxmpp/dispatcher_nb.py
=====================================
--- a/nbxmpp/dispatcher_nb.py
+++ b/nbxmpp/dispatcher_nb.py
@@ -578,11 +578,12 @@ class XMPPDispatcher(PlugIn):
# add timestamp to message stanza in queue
if (stanza.getName() == 'message' and
stanza.getType() in ('chat', 'groupchat')):
- our_jid = stanza.getAttr('from')
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
- stanza.addChild('delay', namespace=NS_DELAY2,
- attrs={'from': our_jid or 'Gajim',
- 'stamp': timestamp})
+ attrs = {'stamp': timestamp}
+ if stanza.getType() != 'groupchat':
+ # Dont leak our JID to Groupchats
+ attrs['from'] = stanza.getAttr('from')
+ stanza.addChild('delay', namespace=NS_DELAY2, attrs=attrs)
self.sm.uqueue.append(stanza)
self.sm.out_h += 1
View it on GitLab:
https://dev.gajim.org/gajim/python-nbxmpp/commit/f62261405ab90ca490c8ae73aa3b602a3a23d03f
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits