Merge branch 'room-fix-notification-count' into 'master'

[Room] Set unread notifications to 0 manually

See merge request famedly/famedlysdk!137
This commit is contained in:
Christian Pauly 2019-12-17 11:16:53 +00:00
commit c2707efe39
2 changed files with 5 additions and 1 deletions

View file

@ -611,6 +611,8 @@ class Room {
/// Sends *m.fully_read* and *m.read* for the given event ID. /// Sends *m.fully_read* and *m.read* for the given event ID.
Future<dynamic> sendReadReceipt(String eventID) async { Future<dynamic> sendReadReceipt(String eventID) async {
this.notificationCount = 0;
client?.store?.resetNotificationCount(this.id);
final dynamic resp = client.connection.jsonRequest( final dynamic resp = client.connection.jsonRequest(
type: HTTPType.POST, type: HTTPType.POST,
action: "/client/r0/rooms/$id/read_markers", action: "/client/r0/rooms/$id/read_markers",
@ -976,7 +978,7 @@ class Room {
} }
Future<dynamic> sendTypingInfo(bool isTyping, {int timeout}) { Future<dynamic> sendTypingInfo(bool isTyping, {int timeout}) {
Map<String,dynamic> data = { Map<String, dynamic> data = {
"typing": isTyping, "typing": isTyping,
}; };
if (timeout != null) data["timeout"] = timeout; if (timeout != null) data["timeout"] = timeout;

View file

@ -92,6 +92,8 @@ abstract class StoreAPI {
Future<void> forgetRoom(String roomID); Future<void> forgetRoom(String roomID);
Future<void> resetNotificationCount(String roomID);
/// Searches for the event in the store. /// Searches for the event in the store.
Future<Event> getEventById(String eventID, Room room); Future<Event> getEventById(String eventID, Room room);