XEP-0313: Only remove origin-id from the mask if it exists

This commit is contained in:
mathieui 2021-03-09 19:17:10 +01:00
parent e329eadbed
commit 644ebfe89f

View file

@ -225,9 +225,10 @@ class XEP_0313(BasePlugin):
iq['mam']['with'] = with_jid iq['mam']['with'] = with_jid
stanza_mask = self.xmpp.Message() 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['id']
del stanza_mask['lang'] del stanza_mask['lang']
stanza_mask['from'] = jid stanza_mask['from'] = jid