From 0a318777ad611e5b0080807e19d5030bbe5e8431 Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Tue, 26 Jul 2022 18:29:44 -0300 Subject: 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. --- post/util.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'post/util.go') 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") -- cgit v1.2.3