basexmpp: Make origin-id opt-out
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
fef575ee1a
commit
3253d34c0a
@ -111,6 +111,9 @@ class BaseXMPP(XMLStream):
|
|||||||
#: outgoing messages an ID.
|
#: outgoing messages an ID.
|
||||||
self.use_presence_ids = True
|
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
|
#: The API registry is a way to process callbacks based on
|
||||||
#: JID+node combinations. Each callback in the registry is
|
#: JID+node combinations. Each callback in the registry is
|
||||||
#: marked with:
|
#: marked with:
|
||||||
|
@ -96,6 +96,9 @@ class Message(RootStanza):
|
|||||||
|
|
||||||
self.xml.attrib['id'] = value
|
self.xml.attrib['id'] = value
|
||||||
|
|
||||||
|
if not self.stream.use_origin_id:
|
||||||
|
return None
|
||||||
|
|
||||||
sub = self.xml.find(ORIGIN_NAME)
|
sub = self.xml.find(ORIGIN_NAME)
|
||||||
if sub is not None:
|
if sub is not None:
|
||||||
sub.attrib['id'] = value
|
sub.attrib['id'] = value
|
||||||
|
Loading…
Reference in New Issue
Block a user