aboutsummaryrefslogtreecommitdiff
path: root/route
diff options
context:
space:
mode:
authorFChannel <>2022-06-14 14:50:32 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit7306338e7f23d652b6b0bfecddcee408a4227169 (patch)
tree58bac2a3a97b1f5456734f654cc6264e919016e7 /route
parent27d0796d7f775034f391ba8aaca99f2a81018842 (diff)
added sendtofollowers to cc incase not already sending to followers
ie. sending from other server than fchannel
Diffstat (limited to 'route')
-rw-r--r--route/routes/actor.go36
1 files changed, 10 insertions, 26 deletions
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)