diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/cache.go | 2 | ||||
-rw-r--r-- | db/database.go | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/db/cache.go b/db/cache.go index 71e244f..a20a8ed 100644 --- a/db/cache.go +++ b/db/cache.go @@ -63,7 +63,7 @@ func WriteActorToCache(actorID string) error { } for _, e := range collection.OrderedItems { - if _, err := activitypub.WriteActorObjectToCache(e); err != nil { + if _, err := e.WriteActorObjectToCache(); err != nil { return err } } diff --git a/db/database.go b/db/database.go index 4c97fe5..e92eec5 100644 --- a/db/database.go +++ b/db/database.go @@ -185,7 +185,8 @@ func RemovePreviewFromFile(id string) error { } } - return activitypub.DeletePreviewFromDB(id) + obj := activitypub.ObjectBase{Id: id} + return obj.DeletePreview() } func GetRandomCaptcha() (string, error) { @@ -395,12 +396,12 @@ func ArchivePosts(actor activitypub.Actor) error { for _, e := range col.OrderedItems { for _, k := range e.Replies.OrderedItems { - if err := activitypub.UpdateObjectTypeDB(k.Id, "Archive"); err != nil { + if err := k.UpdateType("Archive"); err != nil { return err } } - if err := activitypub.UpdateObjectTypeDB(e.Id, "Archive"); err != nil { + if err := e.UpdateType("Archive"); err != nil { return err } } @@ -699,7 +700,7 @@ func DeleteObjectAndRepliesRequest(id string) error { return err } - obj, err := activitypub.GetObjectByIDFromDB(id) + obj, err := nObj.GetCollectionFromPath() if err != nil { return err } |