mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-26 19:01:43 -04:00
add commands to websocket data
This commit is contained in:
parent
ce02611cb8
commit
e58f39bc07
1 changed files with 17 additions and 0 deletions
17
web.py
17
web.py
|
|
@ -136,6 +136,23 @@ def lxmf_delivery(message):
|
|||
"image_bytes": image_bytes,
|
||||
})
|
||||
|
||||
# handle commands field
|
||||
if field_type == LXMF.FIELD_COMMANDS:
|
||||
|
||||
# process commands
|
||||
commands = []
|
||||
for command in value:
|
||||
command_string = command[0]
|
||||
commands.append({
|
||||
"command_string": command_string,
|
||||
})
|
||||
|
||||
# add to fields
|
||||
fields.append({
|
||||
"type": "commands",
|
||||
"commands": commands,
|
||||
})
|
||||
|
||||
# send received lxmf message data to all websocket clients
|
||||
websocket_broadcast(json.dumps({
|
||||
"type": "lxmf.delivery",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue