plugin XEP-0184: show a warning and the message XML on missing id

This commit is contained in:
Goffi 2020-01-27 19:53:31 +01:00
commit b5303be035

View file

@ -152,7 +152,11 @@ class XEP_0184(object):
if self._isActif(client.profile) and client.roster.isPresenceAuthorised(from_jid):
received_elt_ret = domish.Element((NS_MESSAGE_DELIVERY_RECEIPTS, "received"))
received_elt_ret["id"] = msg_elt["id"]
try:
received_elt_ret["id"] = msg_elt["id"]
except KeyError:
log.warning(f"missing id for message element: {msg_elt.toXml}")
return
msg_result_elt = xmlstream.toResponse(msg_elt, "result")
msg_result_elt.addChild(received_elt_ret)