diff --git a/lib/src/room.dart b/lib/src/room.dart index 82eb7e06..a09cf9b0 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -195,7 +195,7 @@ class Room { /// ID of the fully read marker event. String get fullyRead => - roomAccountData['m.fully_read']?.content['event_id'] ?? ''; + roomAccountData['m.fully_read']?.content.tryGet('event_id') ?? ''; /// If something changes, this callback will be triggered. Will return the /// room id. @@ -1192,13 +1192,8 @@ class Room { } /// Get the user fully read marker - String? get userFullyReadMarker { - final readEvent = roomAccountData['m.fully_read']; - if (readEvent != null) { - return readEvent.content.tryGet('event_id'); - } - return null; - } + @Deprecated('Use fullyRead marker') + String? get userFullyReadMarker => fullyRead; /// Sets the position of the read marker for a given room, and optionally the /// read receipt's location. diff --git a/test/room_test.dart b/test/room_test.dart index 57d2b2bf..e475566c 100644 --- a/test/room_test.dart +++ b/test/room_test.dart @@ -98,7 +98,7 @@ void main() { expect( room.getState('m.room.join_rules')?.content['join_rule'], 'public'); expect(room.roomAccountData['com.test.foo']?.content['foo'], 'bar'); - expect(room.userFullyReadMarker, '\$event_id:example.com'); + expect(room.fullyRead, '\$event_id:example.com'); room.setState( Event(