aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/main.go b/main.go
index 8afd834..67ce815 100644
--- a/main.go
+++ b/main.go
@@ -700,9 +700,9 @@ func main() {
obj.Id = id
obj.Actor = &actor
- count, _ := GetObjectRepliesDBCount(db, obj)
+ isOP := CheckIfObjectOP(db, obj.Id)
- if count == 0 {
+ if !isOP {
DeleteObject(db, obj.Id)
http.Redirect(w, r, r.Header.Get("Referer"), http.StatusSeeOther)
return
@@ -1771,14 +1771,22 @@ func DeleteObjectAndRepliesRequest(db *sql.DB, id string) {
activity := CreateActivity("Delete", nObj)
- obj := GetObjectFromPath(db, id)
+ obj := GetObjectByIDFromDB(db, id)
+
+ activity.Actor.Id = obj.OrderedItems[0].Actor.Id
- nObj.Actor = obj.Actor
- followers := GetActorFollowDB(db, obj.Actor.Id)
+ activity.Object = &obj.OrderedItems[0]
+
+ followers := GetActorFollowDB(db, obj.OrderedItems[0].Actor.Id)
for _, e := range followers {
activity.To = append(activity.To, e.Id)
}
+ following := GetActorFollowingDB(db, obj.OrderedItems[0].Actor.Id)
+ for _, e := range following {
+ activity.To = append(activity.To, e.Id)
+ }
+
MakeActivityRequest(db, activity)
}