From bb87ecc1f261355174c8f44e0ed2a1963c834f43 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 17 Dec 2019 12:07:25 +0100 Subject: [PATCH] =?UTF-8?q?[Room]=C2=A0Set=20unread=20notifications=20to?= =?UTF-8?q?=200=20manually?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/Room.dart | 4 +++- lib/src/StoreAPI.dart | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/Room.dart b/lib/src/Room.dart index 26a4a14..e68d46a 100644 --- a/lib/src/Room.dart +++ b/lib/src/Room.dart @@ -611,6 +611,8 @@ class Room { /// Sends *m.fully_read* and *m.read* for the given event ID. Future sendReadReceipt(String eventID) async { + this.notificationCount = 0; + client?.store?.resetNotificationCount(this.id); final dynamic resp = client.connection.jsonRequest( type: HTTPType.POST, action: "/client/r0/rooms/$id/read_markers", @@ -976,7 +978,7 @@ class Room { } Future sendTypingInfo(bool isTyping, {int timeout}) { - Map data = { + Map data = { "typing": isTyping, }; if (timeout != null) data["timeout"] = timeout; diff --git a/lib/src/StoreAPI.dart b/lib/src/StoreAPI.dart index ed05a3a..24800ab 100644 --- a/lib/src/StoreAPI.dart +++ b/lib/src/StoreAPI.dart @@ -92,6 +92,8 @@ abstract class StoreAPI { Future forgetRoom(String roomID); + Future resetNotificationCount(String roomID); + /// Searches for the event in the store. Future getEventById(String eventID, Room room);