From 516536db1c77ab0e9ff9f0f29cd74b1f5b494400 Mon Sep 17 00:00:00 2001 From: liquidraver <504870+liquidraver@users.noreply.github.com> Date: Thu, 21 May 2026 22:34:10 +0200 Subject: [PATCH] joystick UI: "Reset path" now actually forces flood MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The contact submenu's reset-path action set out_path_len = 0, which means "direct, 0 hops" — formatHopCount rendered the contact as "direct" and sendMessage would still try direct send. Use OUT_PATH_UNKNOWN (0xFF) so the next DM floods and rediscovers the path. Also schedule a contacts flush (markContactsDirtyPublic) so the reset survives reboot — previously the change was in-memory only. --- zephcore/helpers/ui-joystick/screens/contacts.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/zephcore/helpers/ui-joystick/screens/contacts.cpp b/zephcore/helpers/ui-joystick/screens/contacts.cpp index f9cd618..cd17c12 100644 --- a/zephcore/helpers/ui-joystick/screens/contacts.cpp +++ b/zephcore/helpers/ui-joystick/screens/contacts.cpp @@ -559,7 +559,16 @@ bool ContactsScreen::handleInput(char key) if (_submenu_selected == _idx_reset_path) { ContactInfo *live = _task->getMesh()->lookupContactByPubKey( _active_contact.id.pub_key, PUB_KEY_SIZE); - if (live) { live->out_path_len = 0; memset(live->out_path, 0, sizeof(live->out_path)); } + if (live) { + /* OUT_PATH_UNKNOWN (0xFF) marks "no saved path → flood". + * Plain 0 would mean "0-hop direct" and the contact would + * render as "direct" instead of forcing a flood-rediscover. */ + live->out_path_len = OUT_PATH_UNKNOWN; + memset(live->out_path, 0, sizeof(live->out_path)); + if (CompanionMesh *cm = static_cast(_task->getMesh())) { + cm->markContactsDirtyPublic(); + } + } _task->showAlert("Path reset", 800); return true; }