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:
parent
44f3d35910
commit
b472dd7b92
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]}");
|
||||
|
|
|
|||
Loading…
Reference in New Issue