# HG changeset patch # User Goffi # Date 1580315940 -3600 # Node ID 49962f9a238a2626b6ecd5e69d04762bb02e6c9a # Parent 46a6251713d368db501e78edff8025262f54921d plugin XEP-0280: handle CCed messages without "to" diff -r 46a6251713d3 -r 49962f9a238a sat/plugins/plugin_xep_0280.py --- a/sat/plugins/plugin_xep_0280.py Wed Jan 29 12:38:48 2020 +0100 +++ b/sat/plugins/plugin_xep_0280.py Wed Jan 29 17:39:00 2020 +0100 @@ -144,7 +144,12 @@ 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(