component AP gateway: handle attachments
This commit is contained in:
parent
072f0cc723
commit
c3f97ec712
1 changed files with 168 additions and 97 deletions
|
|
@ -263,7 +263,7 @@ class XEP_0448:
|
|||
# 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 @@ class XEP_0448:
|
|||
# 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 @@ class XEP_0448:
|
|||
message={'': ''},
|
||||
subject=data['subject'],
|
||||
mess_type=data['type'],
|
||||
extra={C.MESS_KEY_ATTACHMENTS: [attachment]},
|
||||
extra={C.KEY_ATTACHMENTS: [attachment]},
|
||||
)
|
||||
|
||||
if ((not data['extra']
|
||||
|
|
|
|||
Loading…
Reference in a new issue