From 01471c0d2437de12f15ba9175b0fdc390bad5ee1 Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 8 Mar 2026 07:04:33 -0400 Subject: [PATCH] fix nasty bug when updating contact flags --- pyproject.toml | 2 +- src/meshcore/commands/contact.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3d85ab3..eb0adc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "2.2.28" +version = "2.2.29" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Alex Wolden", email="awolden@gmail.com" }, diff --git a/src/meshcore/commands/contact.py b/src/meshcore/commands/contact.py index 517eef8..4240aba 100644 --- a/src/meshcore/commands/contact.py +++ b/src/meshcore/commands/contact.py @@ -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}") # 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_len"] = out_path_len @@ -142,7 +142,7 @@ class ContactCommands(CommandHandlerBase): if out_path_len == -1: # path did not change and contact was flood out_path_len = 255 # we are signed 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: flags = contact["flags"] @@ -170,7 +170,7 @@ class ContactCommands(CommandHandlerBase): return await self.update_contact(contact) 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: return await self.update_contact(contact, flags=flags)