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 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-13 10:36:37 +02:00
parent 4a4ff76f10
commit b50f21060c

View File

@@ -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();
}
}