From 0d4cd485b5225cfa737842de6ba0e96d6d21722b Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 20:07:49 -0800 Subject: removed delete request inside DB delete --- Database.go | 3 --- OutboxPost.go | 2 +- main.go | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Database.go b/Database.go index 640b941..06e8769 100644 --- a/Database.go +++ b/Database.go @@ -935,8 +935,6 @@ func DeleteObject(db *sql.DB, id string) { return } - - DeleteObjectRequest(db, id) DeleteReportActivity(db, id) DeleteAttachmentFromFile(db, id) DeletePreviewFromFile(db, id) @@ -950,7 +948,6 @@ func DeleteObjectAndReplies(db *sql.DB, id string) { return } - DeleteObjectAndRepliesRequest(db, id) DeleteReportActivity(db, id) DeleteAttachmentFromFile(db, id) DeletePreviewFromFile(db, id) diff --git a/OutboxPost.go b/OutboxPost.go index 7349b16..95a7714 100644 --- a/OutboxPost.go +++ b/OutboxPost.go @@ -556,7 +556,7 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { if actor.Id != "" { for _, e := range activity.Object.Replies.OrderedItems { TombstoneObjectFromCache(db, e.Id) - DeleteObject(db, e.Id) + DeleteObject(db, e.Id) } TombstoneObjectFromCache(db, activity.Object.Id) break diff --git a/main.go b/main.go index 67ce815..41c0da4 100644 --- a/main.go +++ b/main.go @@ -703,10 +703,12 @@ func main() { isOP := CheckIfObjectOP(db, obj.Id) if !isOP { + DeleteObjectRequest(db, id) DeleteObject(db, obj.Id) http.Redirect(w, r, r.Header.Get("Referer"), http.StatusSeeOther) return } else { + DeleteObjectAndRepliesRequest(db, id) DeleteObjectAndReplies(db, obj.Id) http.Redirect(w, r, r.Header.Get("Referer"), http.StatusSeeOther) return -- cgit v1.2.3