Modify note inbox to use inbox actor for requesting the note

This commit is contained in:
Melody Becker 2025-05-22 17:01:02 +02:00
parent ef58b5ca9b
commit ca8f5fd483
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI

View file

@ -694,7 +694,17 @@ func handleCreate(w http.ResponseWriter, r *http.Request, object map[string]any)
}
switch val := activity.Object.(type) {
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
case map[string]any:
default: