diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index f0ca372d9..614e19d50 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -329,12 +329,16 @@ func UserIDIsWithinApplicationServiceNamespace( appservice *config.ApplicationService, ) bool { - var local, _, err = gomatrixserverlib.SplitID('@', userID) + var local, domain, err = gomatrixserverlib.SplitID('@', userID) if err != nil { // Not a valid userID return false } + if domain != cfg.Matrix.ServerName { + return false + } + if appservice != nil { if appservice.SenderLocalpart == local { return true