From 916894ab7cd0c36da182ce67320ace6ea223a2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 28 May 2022 13:50:09 +0200 Subject: Change origin-id defaults to False MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/basexmpp.py | 2 +- slixmpp/stanza/message.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slixmpp/basexmpp.py b/slixmpp/basexmpp.py index cd228312..c54ec63a 100644 --- a/slixmpp/basexmpp.py +++ b/slixmpp/basexmpp.py @@ -140,7 +140,7 @@ class BaseXMPP(XMLStream): self.use_presence_ids = True #: XEP-0359 tag that gets added to stanzas. - self.use_origin_id = True + self.use_origin_id = False #: The API registry is a way to process callbacks based on #: JID+node combinations. Each callback in the registry is diff --git a/slixmpp/stanza/message.py b/slixmpp/stanza/message.py index 50d32ff0..eda11df6 100644 --- a/slixmpp/stanza/message.py +++ b/slixmpp/stanza/message.py @@ -64,9 +64,9 @@ class Message(RootStanza): if self.stream: use_ids = getattr(self.stream, 'use_message_ids', None) if use_ids: - self['id'] = self.stream.new_id() + self.set_id(self.stream.new_id()) else: - del self['origin_id'] + self.del_origin_id() def get_type(self): """ @@ -96,8 +96,8 @@ class Message(RootStanza): self.xml.attrib['id'] = value if self.stream: - use_orig_ids = getattr(self.stream, 'use_origin_id', None) - if not use_orig_ids: + if not getattr(self.stream, 'use_origin_id', False): + self.del_origin_id() return None sub = self.xml.find(ORIGIN_NAME) -- cgit v1.2.3