From b50f21060c4da2a7040447bc8a2ac3bd542bc435 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Wed, 13 May 2026 10:36:37 +0200 Subject: [PATCH] fix: clear DM and channel unread counters on app sync completion When companion app finishes syncing all messages (msgRead(0)), clear both _dm_unread_table and _ch_unread so indicators match the app's read state. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/UITask.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index d3939492..b2eb75a5 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1118,6 +1118,10 @@ public: return total; } + void clearAllChannelUnread() { + memset(_ch_unread, 0, sizeof(_ch_unread)); + } + void updateChannelUnread() { if (_hist_sel < 0 || _sel_channel_idx < 0 || _sel_channel_idx >= MAX_GROUP_CHANNELS) return; if (_hist_sel > _viewing_max_seen) _viewing_max_seen = _hist_sel; @@ -2626,6 +2630,7 @@ void UITask::msgRead(int msgcount) { if (msgcount == 0) { _room_unread = 0; memset(_dm_unread_table, 0, sizeof(_dm_unread_table)); + ((QuickMsgScreen*)quick_msg)->clearAllChannelUnread(); } }