mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
add hashtag to scope if absent
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "meshcore"
|
||||
version = "2.3.2"
|
||||
version = "2.3.3"
|
||||
authors = [
|
||||
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
||||
{ name="Alex Wolden", email="awolden@gmail.com" },
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user