mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-30 06:36:38 +00:00
DM and channel history each live in a fixed-size ring (32 DM / 48 channel entries). A conversation that outpaces reading can fill its ring, evicting the oldest entries — including unread ones that were never opened — so the unread badge silently caps at ring capacity instead of reflecting how many messages actually arrived. MessageHistory now tracks a sticky per-channel overflow flag, set at the exact point an unread channel entry gets evicted (mirroring the existing unread-decrement logic) and cleared once the count reads back down to 0. DMUnreadEntry gains the same bit for DM contacts, detected by comparing the raw per-contact counter against actual ring occupancy on each new message (the DM ring, unlike the channel ring, doesn't proactively decrement on eviction). DisplayDriver::drawUnreadBadge/unreadBadgeWidth/fmtBadgeCount take an optional overflow flag (default false, existing call sites unchanged) that appends "+" to the badge. Wired into every place an unread count is shown: DM/favourites and channel lists, the DM/Channels/Rooms mode-select screen, favourite tiles, and the aggregate "Msgs" field on the clock and lock dashboards plus the Messages home-carousel page. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>