diff --git a/sat/plugins/plugin_xep_0280.py b/sat/plugins/plugin_xep_0280.py index 9775d58d..d3f1212b 100644 --- a/sat/plugins/plugin_xep_0280.py +++ b/sat/plugins/plugin_xep_0280.py @@ -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(