Mercurial > libervia-backend
diff sat/plugins/plugin_xep_0448.py @ 4023:78b5f356900c
component AP gateway: handle attachments
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 23 Mar 2023 15:42:21 +0100 |
parents | e345d93fb6e5 |
children | 524856bd7b19 |
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0448.py Thu Mar 23 15:39:48 2023 +0100 +++ b/sat/plugins/plugin_xep_0448.py Thu Mar 23 15:42:21 2023 +0100 @@ -263,7 +263,7 @@ # XXX: for now, XEP-0447/XEP-0448 only allow to send one file per <message/>, thus # we need to send each file in a separate message, in the same way as for # plugin_sec_aesgcm. - attachments = data["extra"][C.MESS_KEY_ATTACHMENTS] + attachments = data["extra"][C.KEY_ATTACHMENTS] if not data['message'] or data['message'] == {'': ''}: extra_attachments = attachments[1:] del attachments[1:] @@ -271,7 +271,7 @@ # we have a message, we must send first attachment separately extra_attachments = attachments[:] attachments.clear() - del data["extra"][C.MESS_KEY_ATTACHMENTS] + del data["extra"][C.KEY_ATTACHMENTS] if attachments: if len(attachments) > 1: @@ -319,7 +319,7 @@ message={'': ''}, subject=data['subject'], mess_type=data['type'], - extra={C.MESS_KEY_ATTACHMENTS: [attachment]}, + extra={C.KEY_ATTACHMENTS: [attachment]}, ) if ((not data['extra']