mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Automatically change the number of unread conversations
This commit is contained in:
@ -16,6 +16,13 @@ class NewNumberNotifsEvent {
|
||||
NewNumberNotifsEvent(this.newNum);
|
||||
}
|
||||
|
||||
/// New number of unread conversations
|
||||
class NewNumberUnreadConversations {
|
||||
final int newNum;
|
||||
|
||||
NewNumberUnreadConversations(this.newNum);
|
||||
}
|
||||
|
||||
class EventsHelper {
|
||||
static EventBus _mgr = EventBus();
|
||||
|
||||
|
@ -80,10 +80,16 @@ class WebSocketHelper {
|
||||
/// Process an unattended message
|
||||
static _processUnattendedMessage(WsMessage msg) {
|
||||
switch (msg.title) {
|
||||
// New number of notifications
|
||||
case "number_notifs":
|
||||
EventsHelper.emit(NewNumberNotifsEvent(msg.data));
|
||||
break;
|
||||
|
||||
// New number of unread conversations
|
||||
case "number_unread_conversations":
|
||||
EventsHelper.emit(NewNumberUnreadConversations(msg.data));
|
||||
break;
|
||||
|
||||
default:
|
||||
throw Exception("Unknown message type: ${msg.title}");
|
||||
}
|
||||
|
Reference in New Issue
Block a user