Fix stale unread badge when message arrives during active conversation

refreshUI() detected and displayed new messages but never called
markRead() or updated the tab badge. Now marks conversation as read
and refreshes the badge whenever new messages are loaded while the
user is actively viewing the conversation.
This commit is contained in:
DeFiDude committed 2026-03-28 14:51:26 -06:00
1 parent 31ce457192
commit 4086609054
1 file changed
+3
+3
View File
@@ -161,6 +161,9 @@ void LvMessageView::refreshUI() {
_cachedMsgs = std::move(newMsgs);
_lastMsgCount = (int)_cachedMsgs.size();
rebuildMessages();
// Mark as read since user is actively viewing this conversation
_lxmf->markRead(_peerHex);
if (_ui) _ui->lvTabBar().setUnreadCount(LvTabBar::TAB_MSGS, _lxmf->unreadCount());
}
}