Check domain name is ours

This commit is contained in:
Neil Alexander 2020-12-18 12:40:36 +00:00
parent 139d935ae6
commit b0ec24ef42
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -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