summaryrefslogtreecommitdiff
path: root/slixmpp
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-09 19:17:10 +0100
committermathieui <mathieui@mathieui.net>2021-03-09 19:52:53 +0100
commit644ebfe89f025d0b0893da2e23cf7f210df8703f (patch)
tree409541c7a83714c005b919be63af1ca04267e437 /slixmpp
parente329eadbedf3dada89f3e7fd5e2bf5d24e995f27 (diff)
downloadslixmpp-644ebfe89f025d0b0893da2e23cf7f210df8703f.tar.gz
slixmpp-644ebfe89f025d0b0893da2e23cf7f210df8703f.tar.bz2
slixmpp-644ebfe89f025d0b0893da2e23cf7f210df8703f.tar.xz
slixmpp-644ebfe89f025d0b0893da2e23cf7f210df8703f.zip
XEP-0313: Only remove origin-id from the mask if it exists
Diffstat (limited to 'slixmpp')
-rw-r--r--slixmpp/plugins/xep_0313/mam.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0313/mam.py b/slixmpp/plugins/xep_0313/mam.py
index cc3b1958..02efd3ce 100644
--- a/slixmpp/plugins/xep_0313/mam.py
+++ b/slixmpp/plugins/xep_0313/mam.py
@@ -225,9 +225,10 @@ class XEP_0313(BasePlugin):
iq['mam']['with'] = with_jid
stanza_mask = self.xmpp.Message()
- stanza_mask.xml.remove(
- stanza_mask.xml.find('{urn:xmpp:sid:0}origin-id')
- )
+
+ auto_origin = stanza_mask.xml.find('{urn:xmpp:sid:0}origin-id')
+ if auto_origin is not None:
+ stanza_mask.xml.remove(auto_origin)
del stanza_mask['id']
del stanza_mask['lang']
stanza_mask['from'] = jid