From 7306338e7f23d652b6b0bfecddcee408a4227169 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Tue, 14 Jun 2022 14:50:32 -0700 Subject: added sendtofollowers to cc incase not already sending to followers ie. sending from other server than fchannel --- route/routes/actor.go | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'route/routes') diff --git a/route/routes/actor.go b/route/routes/actor.go index 413f18c..8690b78 100644 --- a/route/routes/actor.go +++ b/route/routes/actor.go @@ -44,39 +44,23 @@ func ActorInbox(ctx *fiber.Ctx) error { case "Create": for _, e := range activity.To { actor := activitypub.Actor{Id: e} - if local, _ := actor.IsLocal(); local { - if local, _ := activity.Actor.IsLocal(); !local { - reqActivity := activitypub.Activity{Id: activity.Object.Id} - col, err := reqActivity.GetCollection() - if err != nil { - return util.MakeError(err, "ActorInbox") - } - - if len(col.OrderedItems) < 1 { - break - } - - if wantToCache, err := activity.Object.WantToCache(actor); !wantToCache { - return util.MakeError(err, "ActorInbox") - } - - if _, err := activity.Object.WriteCache(); err != nil { - return util.MakeError(err, "ActorInbox") - } + if err := actor.ProcessInboxCreate(activity); err != nil { + return util.MakeError(err, "ActorInbox") + } - if err := actor.ArchivePosts(); err != nil { - return util.MakeError(err, "ActorInbox") - } + if err := actor.SendToFollowers(activity); err != nil { + return util.MakeError(err, "ActorInbox") + } + } - //SendToFollowers(e, activity) - } - } else if err != nil { + for _, e := range activity.Cc { + actor := activitypub.Actor{Id: e} + if err := actor.ProcessInboxCreate(activity); err != nil { return util.MakeError(err, "ActorInbox") } } break - case "Delete": for _, e := range activity.To { actor, err := activitypub.GetActorFromDB(e) -- cgit v1.2.3