diff options
author | mathieui <mathieui@mathieui.net> | 2021-03-09 19:17:10 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-03-09 19:52:53 +0100 |
commit | 644ebfe89f025d0b0893da2e23cf7f210df8703f (patch) | |
tree | 409541c7a83714c005b919be63af1ca04267e437 | |
parent | e329eadbedf3dada89f3e7fd5e2bf5d24e995f27 (diff) | |
download | slixmpp-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
-rw-r--r-- | slixmpp/plugins/xep_0313/mam.py | 7 |
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 |