fix: remove duplicated read marker
This commit is contained in:
parent
d09ed915bc
commit
6c2e525a64
|
|
@ -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<String>('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<String>('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.
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue