mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-06 08:02:46 +00:00
Add user profile tests, refactor user API methods (#3030)
This adds tests for `/profile`. Also, as a first change in this regard, refactors the methods defined on the `UserInternalAPI` to not use structs as the request/response parameters.
This commit is contained in:
parent
4cb9cd7842
commit
c2db38d295
17 changed files with 391 additions and 258 deletions
|
@ -256,17 +256,14 @@ func createInviteFrom3PIDInvite(
|
|||
StateKey: &inv.MXID,
|
||||
}
|
||||
|
||||
var res userapi.QueryProfileResponse
|
||||
err = userAPI.QueryProfile(ctx, &userapi.QueryProfileRequest{
|
||||
UserID: inv.MXID,
|
||||
}, &res)
|
||||
profile, err := userAPI.QueryProfile(ctx, inv.MXID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
content := gomatrixserverlib.MemberContent{
|
||||
AvatarURL: res.AvatarURL,
|
||||
DisplayName: res.DisplayName,
|
||||
AvatarURL: profile.AvatarURL,
|
||||
DisplayName: profile.DisplayName,
|
||||
Membership: gomatrixserverlib.Invite,
|
||||
ThirdPartyInvite: &gomatrixserverlib.MemberThirdPartyInvite{
|
||||
Signed: inv.Signed,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue