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.
Future<dynamic> 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<dynamic> sendTypingInfo(bool isTyping, {int timeout}) {
Map<String,dynamic> data = {
Map<String, dynamic> data = {
"typing": isTyping,
};
if (timeout != null) data["timeout"] = timeout;

View file

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