From fcf666e3cb2f2656020a73e94df332f996924511 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 9 Apr 2021 20:40:30 +0200 Subject: Fix #3441: Do not assign ID to inbound stanzas --- slixmpp/stanza/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'slixmpp/stanza/message.py') diff --git a/slixmpp/stanza/message.py b/slixmpp/stanza/message.py index 7b033e37..debfb380 100644 --- a/slixmpp/stanza/message.py +++ b/slixmpp/stanza/message.py @@ -53,14 +53,14 @@ class Message(RootStanza): lang_interfaces = sub_interfaces types = {'normal', 'chat', 'headline', 'error', 'groupchat'} - def __init__(self, *args, **kwargs): + def __init__(self, *args, recv=False, **kwargs): """ Initialize a new stanza with an optional 'id' value. Overrides StanzaBase.__init__. """ StanzaBase.__init__(self, *args, **kwargs) - if self['id'] == '': + if not recv and self['id'] == '': if self.stream is not None and self.stream.use_message_ids: self['id'] = self.stream.new_id() else: -- cgit v1.2.3