aboutsummaryrefslogtreecommitdiff
path: root/db/database.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-07 15:11:35 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit3c5eebf6275e6d202f8a7b7f027aabcda5c1f332 (patch)
tree5fa2d82f9375ac49be357f0f8b70db06d5c97305 /db/database.go
parent39012c6b17073f6933a5ead8beed64df555f7348 (diff)
more organizing structs to have object functions
need to fully test to be sure nothing broke with changes
Diffstat (limited to 'db/database.go')
-rw-r--r--db/database.go9
1 files changed, 5 insertions, 4 deletions
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
}