basexmpp: Make origin-id opt-out

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-07-20 16:35:18 +02:00
parent fef575ee1a
commit 3253d34c0a
2 changed files with 6 additions and 0 deletions

View file

@ -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:

View file

@ -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