From efcfca02d1e11c9cf7511f6b6a4b957d8e31c1ea Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 25 Mar 2026 20:59:09 -0400 Subject: [PATCH] contact_lastmod can now be chained --- src/meshcore_cli/meshcore_cli.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 3106319..096b70f 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -1215,6 +1215,19 @@ async def process_contact_chat_line(mc, contact, line): print("") return True + if line.startswith("contact_lastmod"): + timestamp = contact["lastmod"] + print(f"{contact['adv_name']} updated" + f" {datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d at %H:%M:%S')}" + f" ({timestamp})", end="") + if " " in line: + print(" ", end="", flush=True) + secline = line.split(" ", 1)[1] + await process_contact_chat_line(mc,contact, secline) + else: + print("") + return True + if line.startswith("path") : if contact['out_path_len'] == -1: print("Flood", end="") @@ -1259,13 +1272,6 @@ async def process_contact_chat_line(mc, contact, line): return True - if line == "contact_lastmod": - timestamp = contact["lastmod"] - print(f"{contact['adv_name']} updated" - f" {datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d at %H:%M:%S')}" - f" ({timestamp})") - return True - # commands that take contact as second arg will be sent to recipient # and can be chained ... if line.startswith("sc") or line.startswith("share_contact") or\