aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime “pep” Buquet2019-07-20 14:35:18 (GMT)
committerMaxime “pep” Buquet2019-08-23 15:09:21 (GMT)
commit3253d34c0a3088c98e7d54bc5f38c118bcbfde2d (patch)
tree1ec0817e34856e7a102e4e7b973466b05b29c5c8
parentfef575ee1a509d2428620e843f83f110a0d82865 (diff)
downloadslixmpp-3253d34c0a3088c98e7d54bc5f38c118bcbfde2d.tar.gz
slixmpp-3253d34c0a3088c98e7d54bc5f38c118bcbfde2d.tar.xz
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/basexmpp.py3
-rw-r--r--slixmpp/stanza/message.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/slixmpp/basexmpp.py b/slixmpp/basexmpp.py
index 146b608..02c0b21 100644
--- a/slixmpp/basexmpp.py
+++ b/slixmpp/basexmpp.py
@@ -111,6 +111,9 @@ class BaseXMPP(XMLStream):
#: outgoing messages an ID.
self.use_presence_ids = True
+ #: XEP-0359 <origin-id/> tag that gets added to <message/> stanzas.
+ self.use_origin_id = True
+
#: The API registry is a way to process callbacks based on
#: JID+node combinations. Each callback in the registry is
#: marked with:
diff --git a/slixmpp/stanza/message.py b/slixmpp/stanza/message.py
index 59707e2..716d48e 100644
--- a/slixmpp/stanza/message.py
+++ b/slixmpp/stanza/message.py
@@ -96,6 +96,9 @@ class Message(RootStanza):
self.xml.attrib['id'] = value
+ if not self.stream.use_origin_id:
+ return None
+
sub = self.xml.find(ORIGIN_NAME)
if sub is not None:
sub.attrib['id'] = value