add hashtag to scope if absent

This commit is contained in:
Florent 2026-03-27 20:12:15 -04:00
parent 4c744888f1
commit fe5096eb9e
2 changed files with 3 additions and 1 deletions

View file

@ -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}")