Return forbidden if not a member anymore (fix #2802)

This commit is contained in:
Till Faelligen 2022-10-25 15:00:52 +02:00
parent db6a214b04
commit 8b7bf5e7d7
No known key found for this signature in database
GPG Key ID: 3DF82D8AB9211D4E

View File

@ -109,6 +109,12 @@ func GetMemberships(
}
if joinedOnly {
if !queryRes.IsInRoom {
return util.JSONResponse{
Code: http.StatusForbidden,
JSON: jsonerror.Forbidden("You aren't a member of the room and weren't previously a member of the room."),
}
}
var res getJoinedMembersResponse
res.Joined = make(map[string]joinedMember)
for _, ev := range result {