aboutsummaryrefslogtreecommitdiff
path: root/routes/admin.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-07 21:21:38 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commitf7bf818d29393ceaccf4d2906557351fa6a4f49f (patch)
tree723e542c8cf0db1e7e64923718977138db77b58d /routes/admin.go
parent3c5eebf6275e6d202f8a7b7f027aabcda5c1f332 (diff)
added error func and general cleanup/organization
Diffstat (limited to 'routes/admin.go')
-rw-r--r--routes/admin.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/routes/admin.go b/routes/admin.go
index f8f55eb..bd489a5 100644
--- a/routes/admin.go
+++ b/routes/admin.go
@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"io/ioutil"
- "log"
"net/http"
"regexp"
"time"
@@ -30,7 +29,6 @@ func AdminVerify(ctx *fiber.Ctx) error {
req, err := http.NewRequest("POST", config.Domain+"/auth", bytes.NewBuffer(j))
if err != nil {
- log.Println("error making verify req")
return err
}
@@ -39,7 +37,6 @@ func AdminVerify(ctx *fiber.Ctx) error {
resp, err := http.DefaultClient.Do(req)
if err != nil {
- log.Println("error getting verify resp")
return err
}
@@ -69,7 +66,6 @@ func AdminAuth(ctx *fiber.Ctx) error {
err := json.Unmarshal(ctx.Body(), &verify)
if err != nil {
- log.Println("error get verify from json")
return err
}
@@ -192,7 +188,8 @@ func AdminFollow(ctx *fiber.Ctx) error {
} else {
followActivity, _ := db.MakeFollowActivity(actorId, follow)
- if isLocal, _ := activitypub.IsActorLocal(followActivity.Object.Actor); !isLocal && followActivity.Actor.Id == config.Domain {
+ actor := activitypub.Actor{Id: followActivity.Object.Actor}
+ if isLocal, _ := actor.IsLocal(); !isLocal && followActivity.Actor.Id == config.Domain {
_, err := ctx.Write([]byte("main board can only follow local boards. Create a new board and then follow outside boards from it."))
return err
}
@@ -303,7 +300,7 @@ func AdminActorIndex(ctx *fiber.Ctx) error {
data.Followers = followers
data.Reported = reports
data.Domain = config.Domain
- data.IsLocal, _ = activitypub.IsActorLocal(actor.Id)
+ data.IsLocal, _ = actor.IsLocal()
data.Title = "Manage /" + actor.Name + "/"
data.Boards = webfinger.Boards