fix: hasNewMessage true when last event is sent
This commit is contained in:
parent
d543a0314d
commit
b30b340b43
|
|
@ -524,12 +524,15 @@ class Room {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the last event is sent, we mark the room as read.
|
||||||
|
if (lastEvent.senderId == client.userID) return false;
|
||||||
|
|
||||||
|
// Get the timestamp of read marker and compare
|
||||||
final readAtMilliseconds = roomAccountData['m.receipt']
|
final readAtMilliseconds = roomAccountData['m.receipt']
|
||||||
?.content
|
?.content
|
||||||
.tryGetMap<String, dynamic>(client.userID!)
|
.tryGetMap<String, dynamic>(client.userID!)
|
||||||
?.tryGet<int>('ts') ??
|
?.tryGet<int>('ts') ??
|
||||||
0;
|
0;
|
||||||
|
|
||||||
return readAtMilliseconds < lastEvent.originServerTs.millisecondsSinceEpoch;
|
return readAtMilliseconds < lastEvent.originServerTs.millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue