MCPcopy Index your code
hub / github.com/writefreely/writefreely / getRemoteUser

Function getRemoteUser

activitypub.go:950–966  ·  view source on GitHub ↗
(app *App, actorID string)

Source from the content-addressed store, hash-verified

948}
949
950func 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

Callers 5

federatePostFunction · 0.85
getActorFunction · 0.85
GetProfileURLFromHandleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected