Implement profile retrieval over federation (#726)

This commit is contained in:
Alex Chen 2019-08-07 00:02:12 +08:00 committed by GitHub
parent 66bf615360
commit 324ca22b35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 100 additions and 25 deletions

View file

@ -20,13 +20,13 @@ package api
import (
"context"
"database/sql"
"errors"
"net/http"
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/dendrite/common"
commonHTTP "github.com/matrix-org/dendrite/common/http"
opentracing "github.com/opentracing/opentracing-go"
)
@ -164,7 +164,7 @@ func RetrieveUserProfile(
// If no user exists, return
if !userResp.UserIDExists {
return nil, errors.New("no known profile for given user ID")
return nil, common.ErrProfileNoExists
}
// Try to query the user from the local database again