mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
contact_lastmod can now be chained
This commit is contained in:
parent
3b41f4e27a
commit
efcfca02d1
1 changed files with 13 additions and 7 deletions
|
|
@ -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\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue