Merge pull request #1990 from famedly/karthi/latestEventReceivedTime

chore: BREAKING rename timeCreated to latestEventReceivedTime in Room
This commit is contained in:
Krille-chan 2025-01-02 09:18:19 +01:00 committed by GitHub
commit 5b376756db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -2998,8 +2998,8 @@ class Client extends MatrixApi {
a.notificationCount != b.notificationCount) {
return b.notificationCount.compareTo(a.notificationCount);
} else {
return b.timeCreated.millisecondsSinceEpoch
.compareTo(a.timeCreated.millisecondsSinceEpoch);
return b.latestEventReceivedTime.millisecondsSinceEpoch
.compareTo(a.latestEventReceivedTime.millisecondsSinceEpoch);
}
};

View File

@ -437,8 +437,9 @@ class Room {
@Deprecated('Use `getLocalizedDisplayname()` instead')
String get displayname => getLocalizedDisplayname();
/// When the last message received.
DateTime get timeCreated => lastEvent?.originServerTs ?? DateTime.now();
/// When was the last event received.
DateTime get latestEventReceivedTime =>
lastEvent?.originServerTs ?? DateTime.now();
/// Call the Matrix API to change the name of this room. Returns the event ID of the
/// new m.room.name event.

View File

@ -257,7 +257,7 @@ void main() {
);
expect(room.lastEvent?.eventId, '12345');
expect(room.lastEvent?.body, 'abc');
expect(room.timeCreated, room.lastEvent?.originServerTs);
expect(room.latestEventReceivedTime, room.lastEvent?.originServerTs);
});
test('lastEvent is set properly', () async {