plugin XEP-0184: show a warning and the message XML on missing id
This commit is contained in:
parent
f496dfc640
commit
b5303be035
1 changed files with 5 additions and 1 deletions
|
|
@ -152,7 +152,11 @@ class XEP_0184(object):
|
||||||
|
|
||||||
if self._isActif(client.profile) and client.roster.isPresenceAuthorised(from_jid):
|
if self._isActif(client.profile) and client.roster.isPresenceAuthorised(from_jid):
|
||||||
received_elt_ret = domish.Element((NS_MESSAGE_DELIVERY_RECEIPTS, "received"))
|
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 = xmlstream.toResponse(msg_elt, "result")
|
||||||
msg_result_elt.addChild(received_elt_ret)
|
msg_result_elt.addChild(received_elt_ret)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue