mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 08:03:09 -06:00
Fix statekey usage in syncapi/history_visibility
This commit is contained in:
parent
7eaa1c33d3
commit
dde8c38800
|
|
@ -134,9 +134,17 @@ func ApplyHistoryVisibilityFilter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// NOTSPEC: Always allow user to see their own membership events (spec contains more "rules")
|
// NOTSPEC: Always allow user to see their own membership events (spec contains more "rules")
|
||||||
if ev.Type() == spec.MRoomMember && ev.StateKeyEquals(userID) {
|
|
||||||
eventsFiltered = append(eventsFiltered, ev)
|
user, err := spec.NewUserID(userID, true)
|
||||||
continue
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
senderID, err := rsAPI.QuerySenderIDForUser(ctx, ev.RoomID(), *user)
|
||||||
|
if err == nil {
|
||||||
|
if ev.Type() == spec.MRoomMember && ev.StateKeyEquals(string(senderID)) {
|
||||||
|
eventsFiltered = append(eventsFiltered, ev)
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Always allow history evVis events on boundaries. This is done
|
// Always allow history evVis events on boundaries. This is done
|
||||||
// by setting the effective evVis to the least restrictive
|
// by setting the effective evVis to the least restrictive
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue