diff options
author | FChannel <> | 2022-05-02 12:44:41 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 1ee6552559141dd5dba91abec7c81d68c56abda0 (patch) | |
tree | 4ac21571a27980e8ebf83a065c270b36cc3ecfd6 /webfinger/webfinger.go | |
parent | 733f911fadc872933481bcbe087d519ce00372df (diff) |
removed all unneeded .go files from root directory
Diffstat (limited to 'webfinger/webfinger.go')
-rw-r--r-- | webfinger/webfinger.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/webfinger/webfinger.go b/webfinger/webfinger.go index a58c9ab..5b96d62 100644 --- a/webfinger/webfinger.go +++ b/webfinger/webfinger.go @@ -283,3 +283,28 @@ func AddInstanceToIndexDB(actor string) error { return nil } + +func MakeActivityFollowingReq(w http.ResponseWriter, r *http.Request, activity activitypub.Activity) (bool, error) { + actor, err := GetActor(activity.Object.Id) + if err != nil { + return false, err + } + + req, err := http.NewRequest("POST", actor.Inbox, nil) + if err != nil { + return false, err + } + + resp, err := util.RouteProxy(req) + if err != nil { + return false, err + } + defer resp.Body.Close() + + body, _ := ioutil.ReadAll(resp.Body) + + var respActivity activitypub.Activity + + err = json.Unmarshal(body, &respActivity) + return respActivity.Type == "Accept", err +} |