mirror of
https://github.com/pelgraine/Meck.git
synced 2026-06-10 16:24:52 +02:00
ed039aa711
The "SMS Inbox" badge on the Phone & SMS landing screen previously showed the number of conversations regardless of read state. It now shows the number of unread received messages and disappears when there are none. Read state is tracked persistently, so it survives reboots and modem power-cycles (the flag lives in each record on the SD card). SMSStore: - Add a `read` byte to SMSRecord, reusing one of the reserved bytes so the record stays 256 bytes and every existing field offset is unchanged (existing .sms files remain readable). - saveMessage marks sent messages read and received messages unread. - loadConversations scans each file and reports unreadCount (received messages with read=0); preview / last-message behaviour is unchanged. - markConversationRead / markFileRead flip received-unread records to read in place (open "r+", rewrite only the affected records). - begin() runs a one-time migration on first boot that marks all pre-existing history read, gated by a marker file (/sms/rdmig.dat), so old messages do not all appear as unread after the update. SMSScreen: - Landing-screen badge sums unreadCount across conversations, hidden at zero. - Opening a conversation marks it read and clears its in-RAM count. - A message arriving while its conversation is open is marked read. - Inbox reloads on the landing screen as well as the inbox view, so the badge updates live when a message arrives.