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

Function getRemoteUserFromHandle

activitypub.go:970–983  ·  view source on GitHub ↗

getRemoteUserFromHandle retrieves the profile page of a remote user from the @user@server.tld handle

(app *App, handle string)

Source from the content-addressed store, hash-verified

968// getRemoteUserFromHandle retrieves the profile page of a remote user
969// from the @user@server.tld handle
970func getRemoteUserFromHandle(app *App, handle string) (*RemoteUser, error) {
971 u := RemoteUser{Handle: handle}
972 var urlVal sql.NullString
973 err := app.db.QueryRow("SELECT id, actor_id, inbox, shared_inbox, url FROM remoteusers WHERE handle = ?", handle).Scan(&u.ID, &u.ActorID, &u.Inbox, &u.SharedInbox, &urlVal)
974 switch {
975 case err == sql.ErrNoRows:
976 return nil, ErrRemoteUserNotFound
977 case err != nil:
978 log.Error("Couldn't get remote user %s: %v", handle, err)
979 return nil, err
980 }
981 u.URL = urlVal.String
982 return &u, nil
983}
984
985// getRemoteUserFromURL retrieves a RemoteUser from their public profile URL.
986func getRemoteUserFromURL(app *App, urlStr string) (*RemoteUser, error) {

Callers 2

GetProfileURLFromHandleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected