mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-11-29 03:16:37 -05:00
support for showing received attachments
This commit is contained in:
parent
f0cb8ee7ee
commit
3a51f11f12
2 changed files with 35 additions and 1 deletions
19
web.py
19
web.py
|
|
@ -107,6 +107,25 @@ def lxmf_delivery(message):
|
|||
|
||||
value = message_fields[field_type]
|
||||
|
||||
# handle file attachments field
|
||||
if field_type == LXMF.FIELD_FILE_ATTACHMENTS:
|
||||
|
||||
# process file attachments
|
||||
file_attachments = []
|
||||
for file_attachment in value:
|
||||
file_name = file_attachment[0]
|
||||
file_bytes = base64.b64encode(file_attachment[1]).decode("utf-8")
|
||||
file_attachments.append({
|
||||
"file_name": file_name,
|
||||
"file_bytes": file_bytes,
|
||||
})
|
||||
|
||||
# add to fields
|
||||
fields.append({
|
||||
"type": "file_attachments",
|
||||
"file_attachments": file_attachments,
|
||||
})
|
||||
|
||||
# handle image field
|
||||
if field_type == LXMF.FIELD_IMAGE:
|
||||
image_type = value[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue