diff options
author | FChannel <> | 2021-06-06 20:22:07 -0700 |
---|---|---|
committer | FChannel <> | 2021-06-06 20:22:07 -0700 |
commit | bf23a5c30ace0525e2ad67a979916af5ebab3001 (patch) | |
tree | 2b592ea4eb26d68bc399f4aaeaa80db4b77eba19 | |
parent | 4cde44d9c4ac46f55f2004baf692fc05beb1f66e (diff) |
nil actor variables for deleting posts
-rw-r--r-- | main.go | 12 | ||||
-rw-r--r-- | outboxPost.go | 1 |
2 files changed, 7 insertions, 6 deletions
@@ -1804,8 +1804,11 @@ func MakeActivityRequest(db *sql.DB, activity Activity) { _, instance := GetActorInstance(actor.Id) if actor.Inbox != "" { + req, err := http.NewRequest("POST", actor.Inbox, bytes.NewBuffer(j)) - + + CheckError(err, "error with sending activity req to") + date := time.Now().UTC().Format(time.RFC1123) path := strings.Replace(actor.Inbox, instance, "", 1) @@ -1821,8 +1824,6 @@ func MakeActivityRequest(db *sql.DB, activity Activity) { req.Header.Set("Signature", signature) req.Host = instance - CheckError(err, "error with sending activity req to") - _, err = http.DefaultClient.Do(req) CheckError(err, "error with sending activity resp to") @@ -1956,8 +1957,9 @@ func DeleteObjectRequest(db *sql.DB, id string) { obj := GetObjectFromPath(db, id) - activity.Actor.Id = obj.Actor.Id - + actor := FingerActor(obj.Actor.Id) + activity.Actor = &actor + followers := GetActorFollowDB(db, obj.Actor.Id) for _, e := range followers { activity.To = append(activity.To, e.Id) diff --git a/outboxPost.go b/outboxPost.go index 03e79ff..e86703d 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -513,7 +513,6 @@ func CheckCaptcha(db *sql.DB, captcha string) bool { func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { activity := GetActivityFromJson(r, db) - if !VerifyHeaderSignature(r, *activity.Actor) { response := RejectActivity(activity) MakeActivityRequest(db, response) |