fix: Send read markers

This commit is contained in:
Christian Pauly 2021-05-15 11:55:04 +02:00
parent 01fbaae93d
commit 08dd2d7d22

View File

@ -160,17 +160,6 @@ class ChatController extends State<Chat> {
throw err; throw err;
}); });
} }
if (room.notificationCount != null &&
room.notificationCount > 0 &&
timeline != null &&
timeline.events.isNotEmpty &&
Matrix.of(context).webHasFocus) {
// ignore: unawaited_futures
room.sendReadMarker(
timeline.events.first.eventId,
readReceiptLocationEventId: timeline.events.first.eventId,
);
}
// when the scroll controller is attached we want to scroll to an event id, if specified // when the scroll controller is attached we want to scroll to an event id, if specified
// and update the scroll controller...which will trigger a request history, if the // and update the scroll controller...which will trigger a request history, if the
@ -185,6 +174,17 @@ class ChatController extends State<Chat> {
}); });
} }
filteredEvents = timeline.getFilteredEvents(unfolded: unfolded); filteredEvents = timeline.getFilteredEvents(unfolded: unfolded);
if (room.notificationCount != null &&
room.notificationCount > 0 &&
timeline != null &&
timeline.events.isNotEmpty &&
Matrix.of(context).webHasFocus) {
// ignore: unawaited_futures
room.sendReadMarker(
timeline.events.first.eventId,
readReceiptLocationEventId: timeline.events.first.eventId,
);
}
return true; return true;
} }