From f6d10bb8b20fc7a05f6bf59643dc775271a3f2bc Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Fri, 29 May 2026 11:11:57 +0200 Subject: [PATCH] fix(ui/favourites): DM unread badge cleared by companion app sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit msgRead(0) was called when the companion app read the last message from the offline queue, and it erased the entire _dm_unread_table. This wiped Favourites Dial badges the moment the app synced — leaving a 3-second window (the alert duration) where the badge was faintly visible behind the incoming-message popup, then gone. _dm_unread_table tracks per-contact UI state (Favourites Dial badges, contact list counters). It should only be cleared by user action: clearDMUnread (opens a DM) or clearAllDMUnread (mark-all-read). It has no relationship to the offline queue drain state. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/UITask.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 3af5ea3b..f7be4cd5 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1344,7 +1344,9 @@ void UITask::msgRead(int msgcount) { _msgcount = msgcount; if (msgcount == 0) { _room_unread = 0; - memset(_dm_unread_table, 0, sizeof(_dm_unread_table)); + // Do NOT clear _dm_unread_table here — it tracks per-contact UI badges + // independently of the offline queue. Badges are cleared only when the + // user opens the DM (clearDMUnread) or explicitly marks all read. ((QuickMsgScreen*)quick_msg)->clearAllChannelUnread(); } }