From 644ebfe89f025d0b0893da2e23cf7f210df8703f Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 9 Mar 2021 19:17:10 +0100 Subject: XEP-0313: Only remove origin-id from the mask if it exists --- slixmpp/plugins/xep_0313/mam.py | 7 ++++--- 1 file 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 -- cgit v1.2.3