|
|
|
@ -2618,21 +2618,21 @@ func (db *datastore) GetProfilePageFromHandle(app *App, handle string) (string, |
|
|
|
|
if errRemoteUser == nil { |
|
|
|
|
_, err := app.db.Exec("UPDATE remoteusers SET handle = ? WHERE actor_id = ?", handle, actorIRI) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("Can't update handle (" + handle + ") in database for user " + actorIRI) |
|
|
|
|
log.Error("Couldn't update handle '%s' for user %s", handle, actorIRI) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// this probably means we don't have the user in the table so let's try to insert it
|
|
|
|
|
// here we need to ask the server for the inboxes
|
|
|
|
|
remoteActor, err := activityserve.NewRemoteActor(actorIRI) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("Couldn't fetch remote actor", err) |
|
|
|
|
log.Error("Couldn't fetch remote actor: %v", err) |
|
|
|
|
} |
|
|
|
|
if debugging { |
|
|
|
|
log.Info("%s %s %s %s", actorIRI, remoteActor.GetInbox(), remoteActor.GetSharedInbox(), handle) |
|
|
|
|
} |
|
|
|
|
_, err = app.db.Exec("INSERT INTO remoteusers (actor_id, inbox, shared_inbox, handle) VALUES(?, ?, ?, ?)", actorIRI, remoteActor.GetInbox(), remoteActor.GetSharedInbox(), handle) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("Can't insert remote user in database", err) |
|
|
|
|
log.Error("Couldn't insert remote user: %v", err) |
|
|
|
|
return "", err |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|