mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Check domain name is ours
This commit is contained in:
parent
139d935ae6
commit
b0ec24ef42
|
|
@ -329,12 +329,16 @@ func UserIDIsWithinApplicationServiceNamespace(
|
||||||
appservice *config.ApplicationService,
|
appservice *config.ApplicationService,
|
||||||
) bool {
|
) bool {
|
||||||
|
|
||||||
var local, _, err = gomatrixserverlib.SplitID('@', userID)
|
var local, domain, err = gomatrixserverlib.SplitID('@', userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Not a valid userID
|
// Not a valid userID
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if domain != cfg.Matrix.ServerName {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if appservice != nil {
|
if appservice != nil {
|
||||||
if appservice.SenderLocalpart == local {
|
if appservice.SenderLocalpart == local {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue