From 40866090544a34104030ced523ecd0eff26cd3b8 Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sat, 28 Mar 2026 14:51:26 -0600 Subject: [PATCH] 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. --- src/ui/screens/LvMessageView.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/screens/LvMessageView.cpp b/src/ui/screens/LvMessageView.cpp index 946e693..0f55816 100644 --- a/src/ui/screens/LvMessageView.cpp +++ b/src/ui/screens/LvMessageView.cpp @@ -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()); } }