mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-31 09:18:12 +00:00
fix(companion): clear stale Locator/Live Share/favourite refs on delete
Deleting a waypoint left the Locator pointed at coordinates that no longer existed (it's a coordinate snapshot, so nothing noticed). Removing a contact was worse: nothing cleared its favourite slot, its Locator/Live Share target, or its per-contact mute/melody entry, so all four kept referencing a pubkey that no longer resolved to anything. - WaypointsView's Delete now calls UITask::clearTargetIfWaypoint() first. - New AbstractUITask::onContactRemoved() hook, called from MyMesh.cpp's CMD_REMOVE_CONTACT handler, clears the favourite slot, the Locator target, and dm_notif/dm_melody entries for that pubkey. Live Share's DM target turns auto-share off instead of guessing a new recipient. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1951,6 +1951,7 @@ void MyMesh::handleCmdFrame(size_t len) {
|
||||
if (recipient && removeContact(*recipient)) {
|
||||
_store->deleteBlobByKey(pub_key, PUB_KEY_SIZE);
|
||||
forgetRoomPassword(pub_key); // drop any saved room login -- useless without the contact
|
||||
if (_ui) _ui->onContactRemoved(pub_key); // drop any favourite slot / Locator / Live Share target pointed at it
|
||||
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY);
|
||||
writeOKFrame();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user