mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-11 19:17:04 +10:00
feat(chat): add "Mark as Unread" action and unread messages divider
- Add "Mark as Unread" option to message context menu in both contact and channel chats - Show "New messages" divider line between read and unread messages - Add setContactUnreadCount/setChannelUnreadCount methods to connector Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -658,6 +658,27 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
void setContactUnreadCount(String contactKeyHex, int count) {
|
||||
_contactUnreadCount[contactKeyHex] = count;
|
||||
_unreadStore.saveContactUnreadCount(
|
||||
Map<String, int>.from(_contactUnreadCount),
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setChannelUnreadCount(int channelIndex, int count) {
|
||||
final channel = _findChannelByIndex(channelIndex);
|
||||
if (channel != null) {
|
||||
channel.unreadCount = count;
|
||||
unawaited(
|
||||
_channelStore.saveChannels(
|
||||
_channels.isNotEmpty ? _channels : _cachedChannels,
|
||||
),
|
||||
);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void markChannelRead(int channelIndex) {
|
||||
final channel = _findChannelByIndex(channelIndex);
|
||||
if (channel != null && channel.unreadCount > 0) {
|
||||
|
||||
Reference in New Issue
Block a user