mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
some logic to specify path_hash_len when setting path
This commit is contained in:
parent
3e37c15ab5
commit
68209df537
1 changed files with 5 additions and 1 deletions
|
|
@ -3244,9 +3244,13 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else:
|
else:
|
||||||
print(f"Unknown contact {cmds[1]}")
|
print(f"Unknown contact {cmds[1]}")
|
||||||
else:
|
else:
|
||||||
path = cmds[2].replace(",","") # we'll accept path with ,
|
path = cmds[2]
|
||||||
if path == "0":
|
if path == "0":
|
||||||
path = ""
|
path = ""
|
||||||
|
elif "," in path and not ":" in path: # deduce path_hash_size from first hash
|
||||||
|
path_hash_size = int(len(path.split(",")[0])/2)
|
||||||
|
path = path + f":{path_hash_size-1}"
|
||||||
|
path = path.replace(",","")
|
||||||
try:
|
try:
|
||||||
res = await mc.commands.change_contact_path(contact, path)
|
res = await mc.commands.change_contact_path(contact, path)
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue