(app *App, actorID string)
| 948 | } |
| 949 | |
| 950 | func getRemoteUser(app *App, actorID string) (*RemoteUser, error) { |
| 951 | u := RemoteUser{ActorID: actorID} |
| 952 | var urlVal, handle sql.NullString |
| 953 | err := app.db.QueryRow("SELECT id, inbox, shared_inbox, url, handle FROM remoteusers WHERE actor_id = ?", actorID).Scan(&u.ID, &u.Inbox, &u.SharedInbox, &urlVal, &handle) |
| 954 | switch { |
| 955 | case err == sql.ErrNoRows: |
| 956 | return nil, impart.HTTPError{http.StatusNotFound, "No remote user with that ID."} |
| 957 | case err != nil: |
| 958 | log.Error("Couldn't get remote user %s: %v", actorID, err) |
| 959 | return nil, err |
| 960 | } |
| 961 | |
| 962 | u.URL = urlVal.String |
| 963 | u.Handle = handle.String |
| 964 | |
| 965 | return &u, nil |
| 966 | } |
| 967 | |
| 968 | // getRemoteUserFromHandle retrieves the profile page of a remote user |
| 969 | // from the @user@server.tld handle |
no outgoing calls
no test coverage detected