Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement profile retrieval over federation - fixes #651 #726

Open
wants to merge 5 commits into
base: master
from

Conversation

2 participants
@Cnly
Copy link
Collaborator

commented Jul 1, 2019

This should fix #651.

Signed-off-by: Alex Chen minecnly@gmail.com

Pull Request Checklist

  • I have added any new tests that need to pass to testfile as specified in docs/sytest.md
  • Pull request includes a sign off
Implement profile retrieval over federation - fixes #651
Signed-off-by: Alex Chen <minecnly@gmail.com>

@anoadragon453 anoadragon453 added this to In progress in Homeserver Task Board via automation Jul 9, 2019

@anoadragon453 anoadragon453 moved this from In progress to Community PRs in Homeserver Task Board Jul 9, 2019

@anoadragon453 anoadragon453 self-assigned this Jul 9, 2019

@anoadragon453 anoadragon453 self-requested a review Jul 11, 2019

@anoadragon453
Copy link
Member

left a comment

Looks good! Just some small things.

if err == common.ErrProfileNoExists {
return util.JSONResponse{
Code: http.StatusNotFound,
JSON: jsonerror.NotFound("The user does not exist or does not have a profile"),

This comment has been minimized.

Copy link
@anoadragon453

anoadragon453 Jul 11, 2019

Member

Here and the lines below may be a good place to use common.ErrProfileNoexists.

This comment has been minimized.

Copy link
@Cnly

Cnly Jul 12, 2019

Author Collaborator

Hmmm, not sure I fully get you here. Could you perhaps explain a little bit with the new commit added now?

if err != nil {
if err == common.ErrProfileNoExists {

This comment has been minimized.

Copy link
@anoadragon453

anoadragon453 Jul 11, 2019

Member

Lines 80-92 are repeated quite a bit and could probably be refactored into their own function.

This comment has been minimized.

Copy link
@Cnly

Cnly Jul 12, 2019

Author Collaborator

getProfile now converts a federation 404 to a common.ErrProfileNoExists. Does that look better now?

Show resolved Hide resolved clientapi/routing/profile.go
Better errors
Signed-off-by: Alex Chen <minecnly@gmail.com>

@Cnly Cnly requested a review from anoadragon453 Jul 12, 2019

Cnly added some commits Jul 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.