chore: BREAKING rename timeCreated to latestEventReceivedTime in Room
This commit is contained in:
parent
0caec7ca17
commit
05ee4031bf
|
|
@ -2998,8 +2998,8 @@ class Client extends MatrixApi {
|
||||||
a.notificationCount != b.notificationCount) {
|
a.notificationCount != b.notificationCount) {
|
||||||
return b.notificationCount.compareTo(a.notificationCount);
|
return b.notificationCount.compareTo(a.notificationCount);
|
||||||
} else {
|
} else {
|
||||||
return b.timeCreated.millisecondsSinceEpoch
|
return b.latestEventReceivedTime.millisecondsSinceEpoch
|
||||||
.compareTo(a.timeCreated.millisecondsSinceEpoch);
|
.compareTo(a.latestEventReceivedTime.millisecondsSinceEpoch);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -437,8 +437,9 @@ class Room {
|
||||||
@Deprecated('Use `getLocalizedDisplayname()` instead')
|
@Deprecated('Use `getLocalizedDisplayname()` instead')
|
||||||
String get displayname => getLocalizedDisplayname();
|
String get displayname => getLocalizedDisplayname();
|
||||||
|
|
||||||
/// When the last message received.
|
/// When was the last event received.
|
||||||
DateTime get timeCreated => lastEvent?.originServerTs ?? DateTime.now();
|
DateTime get latestEventReceivedTime =>
|
||||||
|
lastEvent?.originServerTs ?? DateTime.now();
|
||||||
|
|
||||||
/// Call the Matrix API to change the name of this room. Returns the event ID of the
|
/// Call the Matrix API to change the name of this room. Returns the event ID of the
|
||||||
/// new m.room.name event.
|
/// new m.room.name event.
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ void main() {
|
||||||
);
|
);
|
||||||
expect(room.lastEvent?.eventId, '12345');
|
expect(room.lastEvent?.eventId, '12345');
|
||||||
expect(room.lastEvent?.body, 'abc');
|
expect(room.lastEvent?.body, 'abc');
|
||||||
expect(room.timeCreated, room.lastEvent?.originServerTs);
|
expect(room.latestEventReceivedTime, room.lastEvent?.originServerTs);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('lastEvent is set properly', () async {
|
test('lastEvent is set properly', () async {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue