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