mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
add hashtag to scope if absent
This commit is contained in:
parent
4c744888f1
commit
fe5096eb9e
2 changed files with 3 additions and 1 deletions
|
|
@ -269,6 +269,8 @@ class MessagingCommands(CommandHandlerBase):
|
|||
scope_key = b"\0"*16
|
||||
else:
|
||||
logger.debug(f"Setting scope from string {scope}")
|
||||
if scope[0] != "#": # no hashtag as first char
|
||||
scope = "#" + scope # adding hashtag
|
||||
scope_key = sha256(scope.encode("utf-8")).digest()[0:16]
|
||||
elif isinstance (scope, bytes): # scope has been sent directly as byte
|
||||
logger.debug(f"Directly setting scope to {scope}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue