mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -06:00
Check if user is local before lookin up their profile
This commit is contained in:
parent
aae9d3064b
commit
19c8644044
|
|
@ -42,14 +42,19 @@ func SendMembership(
|
|||
return *reqErr
|
||||
}
|
||||
|
||||
localpart, _, err := gomatrixserverlib.SplitID('@', stateKey)
|
||||
localpart, serverName, err := gomatrixserverlib.SplitID('@', stateKey)
|
||||
if err != nil {
|
||||
return httputil.LogThenError(req, err)
|
||||
}
|
||||
|
||||
profile, err := accountDB.GetProfileByLocalpart(localpart)
|
||||
if err != nil {
|
||||
return httputil.LogThenError(req, err)
|
||||
var profile *authtypes.Profile
|
||||
if serverName == cfg.Matrix.ServerName {
|
||||
profile, err = accountDB.GetProfileByLocalpart(localpart)
|
||||
if err != nil {
|
||||
return httputil.LogThenError(req, err)
|
||||
}
|
||||
} else {
|
||||
profile = &authtypes.Profile{}
|
||||
}
|
||||
|
||||
builder := gomatrixserverlib.EventBuilder{
|
||||
|
|
|
|||
Loading…
Reference in a new issue