fix: Room Member updates should always be cached

I think the commit which broke it was this: e3bd0cf1 It makes sure that only important state events get cached and room member events are not important state events and so new invites have no room member events cached. It makes sense to also allow room member events here to always be cached as they are special typed.
This commit is contained in:
Krille Fear 2022-01-08 10:24:40 +01:00
parent 44f3d35910
commit b472dd7b92
2 changed files with 8 additions and 1 deletions

View File

@ -1709,7 +1709,9 @@ class Client extends MatrixApi {
stateEvent.relationshipEventId ==
room.lastEvent?.relationshipEventId;
final importantOrRoomLoaded =
!room.partial || importantStateEvents.contains(stateEvent.type);
eventUpdate.type == EventUpdateType.inviteState ||
!room.partial ||
importantStateEvents.contains(stateEvent.type);
if ((noMessageOrNoEdit || editingLastEvent || consecutiveEdit) &&
importantOrRoomLoaded) {
room.setState(stateEvent);

View File

@ -141,6 +141,11 @@ void main() {
matrix.rooms[1].roomAccountData['m.receipt']
?.content['@alice:example.com']['event_id'],
'7365636s6r6432:example.com');
final inviteRoom = matrix.rooms
.singleWhere((room) => room.membership == Membership.invite);
expect(inviteRoom.name, 'My Room Name');
expect(inviteRoom.states[EventTypes.RoomMember]?.length, 1);
expect(matrix.rooms.length, 2);
expect(matrix.rooms[1].canonicalAlias,
"#famedlyContactDiscovery:${matrix.userID!.split(":")[1]}");