From f36ab489e3642816c2ec1dfae491d015ebc655ba Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 29 Apr 2025 09:42:21 +0200 Subject: [PATCH] implement ! => reply to last sender --- src/meshcore_cli/meshcore_cli.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index b482e17..1678790 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -496,6 +496,18 @@ Line starting with \"$\" or \".\" will issue a meshcli command. args = shlex.split(line) await process_cmds(mc, args) + # lines starting with ! are sent as reply to last received msg + elif line.startswith("!"): + ln = process_event_message.last_node + if ln is None : + print("No received msg yet !") + elif ln["type"] == 0 : + await process_cmds(mc, ["chan", str(contact["chan_nb"]), line] ) + else : + last_ack = await msg_ack(mc, ln, line[1:]) + if last_ack == False : + contact = ln + # commands that take contact as second arg will be sent to recipient elif contact["type"] > 0 and (line == "sc" or line == "share_contact" or\ line == "ec" or line == "export_contact" or\