|
|
@ -708,7 +708,8 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error { |
|
|
|
|
|
|
|
|
|
|
|
func getRemoteUser(app *App, actorID string) (*RemoteUser, error) { |
|
|
|
func getRemoteUser(app *App, actorID string) (*RemoteUser, error) { |
|
|
|
u := RemoteUser{ActorID: actorID} |
|
|
|
u := RemoteUser{ActorID: actorID} |
|
|
|
err := app.db.QueryRow("SELECT id, inbox, shared_inbox, handle FROM remoteusers WHERE actor_id = ?", actorID).Scan(&u.ID, &u.Inbox, &u.SharedInbox, &u.Handle) |
|
|
|
var handle sql.NullString |
|
|
|
|
|
|
|
err := app.db.QueryRow("SELECT id, inbox, shared_inbox, handle FROM remoteusers WHERE actor_id = ?", actorID).Scan(&u.ID, &u.Inbox, &u.SharedInbox, &handle) |
|
|
|
switch { |
|
|
|
switch { |
|
|
|
case err == sql.ErrNoRows: |
|
|
|
case err == sql.ErrNoRows: |
|
|
|
return nil, impart.HTTPError{http.StatusNotFound, "No remote user with that ID."} |
|
|
|
return nil, impart.HTTPError{http.StatusNotFound, "No remote user with that ID."} |
|
|
@ -717,6 +718,8 @@ func getRemoteUser(app *App, actorID string) (*RemoteUser, error) { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u.Handle = handle.String |
|
|
|
|
|
|
|
|
|
|
|
return &u, nil |
|
|
|
return &u, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|