aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-28 19:59:37 -0800
committerFChannel <=>2021-01-28 19:59:37 -0800
commit26db3d04944e838e6de5aeb736c59982ed226c48 (patch)
tree797b2329ecddbe34862ca49c57b6c6b7410c2791 /main.go
parent42e7acc965daea755a84064f68e4eebf3e3b2e11 (diff)
delete objects local and remote
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)
}