diff options
-rw-r--r-- | slixmpp/basexmpp.py | 3 | ||||
-rw-r--r-- | slixmpp/stanza/message.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/slixmpp/basexmpp.py b/slixmpp/basexmpp.py index 146b6086..02c0b21c 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 59707e25..716d48e0 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 |