plugin XEP-0280: handle CCed messages without "to"

This commit is contained in:
Goffi 2020-01-29 17:39:00 +01:00
commit 8937201eed

View file

@ -144,7 +144,12 @@ class XEP_0280(object):
if carbons_elt.name == "received":
message_elt["from"] = cc_message_elt["from"]
elif carbons_elt.name == "sent":
message_elt["to"] = cc_message_elt["to"]
try:
message_elt["to"] = cc_message_elt["to"]
except KeyError:
# we may not have "to" in case of message from ourself (from an other
# device)
pass
else:
log.warning(
"invalid message carbons received:\n{xml}".format(