From cfff1b0aaafc68efbac27f366360667983f7696a Mon Sep 17 00:00:00 2001 From: S7evinK <2353100+S7evinK@users.noreply.github.com> Date: Tue, 22 Feb 2022 16:50:04 +0100 Subject: [PATCH] Remote banned user is kicked and may not rejoin until unbanned (#2216) * Remote banned user is kicked and may not rejoin until unbanned * Use gmsl constant --- clientapi/routing/state.go | 2 +- sytest-whitelist | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/state.go b/clientapi/routing/state.go index 088e412c..d25ee823 100644 --- a/clientapi/routing/state.go +++ b/clientapi/routing/state.go @@ -235,7 +235,7 @@ func OnIncomingStateTypeRequest( } // If the user has never been in the room then stop at this point. // We won't tell the user about a room they have never joined. - if !membershipRes.HasBeenInRoom { + if !membershipRes.HasBeenInRoom || membershipRes.Membership == gomatrixserverlib.Ban { return util.JSONResponse{ Code: http.StatusForbidden, JSON: jsonerror.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)), diff --git a/sytest-whitelist b/sytest-whitelist index 187a0f47..87904938 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -596,4 +596,5 @@ Device list doesn't change if remote server is down /context/ on joined room works /context/ on non world readable room does not work /context/ returns correct number of events -/context/ with lazy_load_members filter works \ No newline at end of file +/context/ with lazy_load_members filter works +Remote banned user is kicked and may not rejoin until unbanned