aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorFChannel <>2021-06-28 11:08:15 -0700
committerFChannel <>2021-06-28 11:08:15 -0700
commit94c92948ae7ae669b6b6466ef4b7f00cc430f7ef (patch)
treed832efcc1590d0d7b40ef639712324a0103fb070 /client.go
parent34fa3d38b97ff08130e8709c4820915dfd684b19 (diff)
added proxy wrapper with tor support
Diffstat (limited to 'client.go')
-rw-r--r--client.go34
1 files changed, 1 insertions, 33 deletions
diff --git a/client.go b/client.go
index 91f5f1f..b7f1938 100644
--- a/client.go
+++ b/client.go
@@ -9,8 +9,6 @@ import "strings"
import "strconv"
import "sort"
import "regexp"
-import "io/ioutil"
-import "encoding/json"
import "os"
var Key *string = new(string)
@@ -241,43 +239,13 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){
t.ExecuteTemplate(w, "layout", returnData)
}
-func GetRemoteActor(id string) Actor {
-
- var respActor Actor
-
- id = StripTransferProtocol(id)
-
- req, err := http.NewRequest("GET", "http://" + id, nil)
-
- CheckError(err, "error with getting actor req")
-
- req.Header.Set("Accept", activitystreams)
-
- resp, err := http.DefaultClient.Do(req)
-
- if err != nil || resp.StatusCode != 200 {
- fmt.Println("could not get actor from " + id)
- return respActor
- }
-
- defer resp.Body.Close()
-
- body, _ := ioutil.ReadAll(resp.Body)
-
- err = json.Unmarshal(body, &respActor)
-
- CheckError(err, "error getting actor from body")
-
- return respActor
-}
-
func GetBoardCollection(db *sql.DB) []Board {
var collection []Board
for _, e := range FollowingBoards {
var board Board
boardActor := GetActorFromDB(db, e.Id)
if boardActor.Id == "" {
- boardActor = GetRemoteActor(e.Id)
+ boardActor = FingerActor(e.Id)
}
board.Name = "/" + boardActor.Name + "/"
board.PrefName = boardActor.PreferredUsername