From 1ee6552559141dd5dba91abec7c81d68c56abda0 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 2 May 2022 12:44:41 -0700 Subject: removed all unneeded .go files from root directory --- webfinger/webfinger.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'webfinger/webfinger.go') 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 +} -- cgit v1.2.3