From 3c5eebf6275e6d202f8a7b7f027aabcda5c1f332 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 7 May 2022 15:11:35 -0700 Subject: more organizing structs to have object functions need to fully test to be sure nothing broke with changes --- routes/actor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'routes/actor.go') diff --git a/routes/actor.go b/routes/actor.go index ea8656f..86a5fb9 100644 --- a/routes/actor.go +++ b/routes/actor.go @@ -43,7 +43,7 @@ func ActorInbox(ctx *fiber.Ctx) error { for _, e := range activity.To { if res, err := activitypub.IsActorLocal(e); err == nil && res { if res, err := activitypub.IsActorLocal(activity.Actor.Id); err == nil && res { - col, err := activitypub.GetCollectionFromID(activity.Object.Id) + col, err := activity.Object.GetCollection() if err != nil { return err } @@ -52,7 +52,7 @@ func ActorInbox(ctx *fiber.Ctx) error { break } - if _, err := activitypub.WriteObjectToCache(*activity.Object); err != nil { + if err := activity.Object.WriteCache(); err != nil { return err } @@ -84,15 +84,15 @@ func ActorInbox(ctx *fiber.Ctx) error { } if actor.Id != "" && actor.Id != config.Domain { - if activity.Object.Replies != nil { + if activity.Object.Replies.OrderedItems != nil { for _, k := range activity.Object.Replies.OrderedItems { - if err := activitypub.TombstoneObject(k.Id); err != nil { + if err := k.Tombstone(); err != nil { return err } } } - if err := activitypub.TombstoneObject(activity.Object.Id); err != nil { + if err := activity.Object.Tombstone(); err != nil { return err } if err := actor.UnArchiveLast(); err != nil { -- cgit v1.2.3