mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
when remote page receive chat message: if minimized, top page and switch tab, otherwise add unread message count
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -285,6 +285,29 @@ class PeerStringOption {
|
||||
Get.find<RxString>(tag: tag(id, opt));
|
||||
}
|
||||
|
||||
class UnreadChatCountState {
|
||||
static String tag(id) => 'unread_chat_count_$id';
|
||||
|
||||
static void init(String id) {
|
||||
final key = tag(id);
|
||||
if (!Get.isRegistered(tag: key)) {
|
||||
final RxInt state = RxInt(0);
|
||||
Get.put(state, tag: key);
|
||||
} else {
|
||||
Get.find<RxInt>(tag: key).value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void delete(String id) {
|
||||
final key = tag(id);
|
||||
if (Get.isRegistered(tag: key)) {
|
||||
Get.delete(tag: key);
|
||||
}
|
||||
}
|
||||
|
||||
static RxInt find(String id) => Get.find<RxInt>(tag: tag(id));
|
||||
}
|
||||
|
||||
initSharedStates(String id) {
|
||||
PrivacyModeState.init(id);
|
||||
BlockInputState.init(id);
|
||||
@@ -294,6 +317,7 @@ initSharedStates(String id) {
|
||||
RemoteCursorMovedState.init(id);
|
||||
FingerprintState.init(id);
|
||||
PeerBoolOption.init(id, 'zoom-cursor', () => false);
|
||||
UnreadChatCountState.init(id);
|
||||
}
|
||||
|
||||
removeSharedStates(String id) {
|
||||
@@ -305,4 +329,5 @@ removeSharedStates(String id) {
|
||||
RemoteCursorMovedState.delete(id);
|
||||
FingerprintState.delete(id);
|
||||
PeerBoolOption.delete(id, 'zoom-cursor');
|
||||
UnreadChatCountState.delete(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user