From 9671325c506cc4b7a64b6bb6ea42fddf2e2fa74c Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 May 2026 19:01:12 -0500 Subject: [PATCH] fix(identity_context): guard inbound stamp cost comparison against non-int values --- meshchatx/src/backend/identity_context.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/meshchatx/src/backend/identity_context.py b/meshchatx/src/backend/identity_context.py index 2407fe4..f2f5cce 100644 --- a/meshchatx/src/backend/identity_context.py +++ b/meshchatx/src/backend/identity_context.py @@ -217,6 +217,14 @@ class IdentityContext: # Register LXMF delivery identity inbound_stamp_cost = self.config.lxmf_inbound_stamp_cost.get() + # Enforce max stamp cost when block strangers is enabled on startup + if ( + self.config.block_all_from_strangers.get() + and isinstance(inbound_stamp_cost, int) + and inbound_stamp_cost < 254 + ): + inbound_stamp_cost = 254 + self.config.lxmf_inbound_stamp_cost.set(254) self.local_lxmf_destination = self.message_router.register_delivery_identity( identity=self.identity, display_name=self.config.display_name.get(), @@ -413,6 +421,18 @@ class IdentityContext: thread.daemon = True thread.start() + # start background thread for LXMF flood protection cooldown + thread = threading.Thread( + target=asyncio.run, + args=( + self.app.lxmf_flood_protection_cooldown_loop( + self.session_id, context=self + ), + ), + ) + thread.daemon = True + thread.start() + # start background thread for auto propagation node selection thread = threading.Thread( target=asyncio.run,