Modify note inbox to use inbox actor for requesting the note
This commit is contained in:
parent
ef58b5ca9b
commit
ca8f5fd483
1 changed files with 11 additions and 1 deletions
|
@ -694,7 +694,17 @@ func handleCreate(w http.ResponseWriter, r *http.Request, object map[string]any)
|
||||||
}
|
}
|
||||||
switch val := activity.Object.(type) {
|
switch val := activity.Object.(type) {
|
||||||
case string:
|
case string:
|
||||||
activitypub.ImportRemoteNote(val)
|
actor, err := dbgen.User.GetById(r.PathValue("id"))
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("Failed to get local actor for importing targeted note")
|
||||||
|
webutils.ProblemDetailsStatusOnly(w, http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, err = activitypub.ImportRemoteNote(val, actor)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Str("note-url", val).Msg("Failed to import remote note that landed as id in the inbox")
|
||||||
|
webutils.ProblemDetailsStatusOnly(w, http.StatusInternalServerError)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
case map[string]any:
|
case map[string]any:
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue