Unread badges per category + context menu stays open on action

- newMsg() now takes contact_type; room server messages (ADV_TYPE_ROOM)
  tracked separately in _room_unread; DM badge = msgCount - roomUnread
- MODE_SELECT shows unread badges for all 3 rows: DM, Channels, Rooms
- Room unread cleared when user opens Room Servers list or msgRead(0)
- Channel context menu: ENTER performs action but stays open; only
  CANCEL (Back button) closes it so user can see the updated state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-11 19:27:16 +02:00
parent 1a1cda4a1a
commit 158bbf74c8
4 changed files with 22 additions and 9 deletions

View File

@@ -464,7 +464,7 @@ void MyMesh::queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packe
// we only want to show text messages on display, not cli data
bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN;
if (should_display && _ui) {
_ui->newMsg(path_len, from.name, text, offline_queue_len);
_ui->newMsg(path_len, from.name, text, offline_queue_len, from.type);
if (!_serial->isConnected()) {
_ui->notify(UIEventType::contactMessage);
}
@@ -573,7 +573,7 @@ void MyMesh::onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packe
if (getChannel(channel_idx, channel_details)) {
channel_name = channel_details.name;
}
if (_ui) _ui->newMsg(path_len, channel_name, text, offline_queue_len);
if (_ui) _ui->newMsg(path_len, channel_name, text, offline_queue_len, 0);
#endif
}