diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2022-07-26 18:29:44 -0300 |
---|---|---|
committer | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2022-07-26 18:29:44 -0300 |
commit | 0a318777ad611e5b0080807e19d5030bbe5e8431 (patch) | |
tree | b916a6523f5096a423366874e55b44a92d1b036d /post | |
parent | 3a7664d404bca40cb3234924fa969c0ae133d085 (diff) |
fix fail with posting to a down instance's thread
in a couple of scenarios, fchannel may fail to contact a server and due
to faulty error handling, activities that are supposed to send never do.
this commit corrects said error handling.
Diffstat (limited to 'post')
-rw-r--r-- | post/util.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/post/util.go b/post/util.go index 922dd11..bb24c90 100644 --- a/post/util.go +++ b/post/util.go @@ -287,12 +287,10 @@ func ObjectFromForm(ctx *fiber.Ctx, obj activitypub.ObjectBase) (activitypub.Obj if originalPost.Id != "" { if local, _ := activity.IsLocal(); !local { actor, err := activitypub.FingerActor(originalPost.Id) - if err != nil { - return obj, util.MakeError(err, "ObjectFromForm") - } - - if !util.IsInStringArray(obj.To, actor.Id) { - obj.To = append(obj.To, actor.Id) + if err == nil { // Keep things moving if it fails + if !util.IsInStringArray(obj.To, actor.Id) { + obj.To = append(obj.To, actor.Id) + } } } else if err != nil { return obj, util.MakeError(err, "ObjectFromForm") |