fix nasty bug when updating contact flags

This commit is contained in:
Florent
2026-03-08 07:04:33 -04:00
parent cda44ae0a0
commit 01471c0d24
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "meshcore" name = "meshcore"
version = "2.2.28" version = "2.2.29"
authors = [ authors = [
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
{ name="Alex Wolden", email="awolden@gmail.com" }, { name="Alex Wolden", email="awolden@gmail.com" },

View File

@@ -134,7 +134,7 @@ class ContactCommands(CommandHandlerBase):
logger.debug(f"Setting {contact['adv_name']} path to {out_path_hex} with mode {out_path_hash_mode}") logger.debug(f"Setting {contact['adv_name']} path to {out_path_hex} with mode {out_path_hash_mode}")
# reflect the change # reflect the change
contact["out_path_hash_mode"] = path_hash_mode contact["out_path_hash_mode"] = out_path_hash_mode
contact["out_path"] = out_path_hex contact["out_path"] = out_path_hex
contact["out_path_len"] = out_path_len contact["out_path_len"] = out_path_len
@@ -142,7 +142,7 @@ class ContactCommands(CommandHandlerBase):
if out_path_len == -1: # path did not change and contact was flood if out_path_len == -1: # path did not change and contact was flood
out_path_len = 255 # we are signed out_path_len = 255 # we are signed
else: else:
out_path_len = out_path_len | (path_hash_mode << 6) out_path_len = out_path_len | (out_path_hash_mode << 6)
if flags is None: if flags is None:
flags = contact["flags"] flags = contact["flags"]
@@ -170,7 +170,7 @@ class ContactCommands(CommandHandlerBase):
return await self.update_contact(contact) return await self.update_contact(contact)
async def change_contact_path(self, contact, path, path_hash_mode=None) -> Event: async def change_contact_path(self, contact, path, path_hash_mode=None) -> Event:
return await self.update_contact(contact, path, path_hash_mode) return await self.update_contact(contact, path, path_hash_mode=path_hash_mode)
async def change_contact_flags(self, contact, flags) -> Event: async def change_contact_flags(self, contact, flags) -> Event:
return await self.update_contact(contact, flags=flags) return await self.update_contact(contact, flags=flags)