aboutsummaryrefslogtreecommitdiff
path: root/routes/index.go
diff options
context:
space:
mode:
authorKushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com>2021-11-02 16:10:57 -0300
committerFChannel <>2022-06-19 12:53:29 -0700
commitbc9051fd1a17e793647cf309c973a7feefebd98f (patch)
treebf16a2176e9129c3921ef6743a6c22781e744064 /routes/index.go
parentd80afd8a49f552c5dc51d8346d40809298fef11f (diff)
down to the main package it seems
Diffstat (limited to 'routes/index.go')
-rw-r--r--routes/index.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/routes/index.go b/routes/index.go
index df10d9f..a130796 100644
--- a/routes/index.go
+++ b/routes/index.go
@@ -3,11 +3,12 @@ package routes
import (
"github.com/FChannel0/FChannel-Server/config"
"github.com/FChannel0/FChannel-Server/db"
+ "github.com/FChannel0/FChannel-Server/webfinger"
"github.com/gofiber/fiber/v2"
)
func Index(c *fiber.Ctx) error {
- actor, err := db.GetActor(config.Domain)
+ actor, err := db.GetActorFromDB(config.Domain)
if err != nil {
return err
}
@@ -15,11 +16,11 @@ func Index(c *fiber.Ctx) error {
var data PageData
data.Title = "Welcome to " + actor.PreferredUsername
data.PreferredUsername = actor.PreferredUsername
- data.Boards = Boards
+ data.Boards = db.Boards
data.Board.Name = ""
- data.Key = *Key
+ data.Key = config.Key
data.Board.Domain = config.Domain
- data.Board.ModCred, _ = GetPasswordFromCtx(c)
+ data.Board.ModCred, _ = getPassword(c)
data.Board.Actor = actor
data.Board.Post.Actor = actor.Id
data.Board.Restricted = actor.Restricted
@@ -30,7 +31,10 @@ func Index(c *fiber.Ctx) error {
data.BoardRemainer = make([]int, 0)
}
- col := GetCollectionFromReq("https://fchan.xyz/followers")
+ col, err := webfinger.GetCollectionFromReq("https://fchan.xyz/followers")
+ if err != nil {
+ return err
+ }
if len(col.Items) > 0 {
data.InstanceIndex = col.Items
@@ -41,7 +45,7 @@ func Index(c *fiber.Ctx) error {
return err
}
- data.Themes = &Themes
+ data.Themes = &config.Themes
data.ThemeCookie = getThemeCookie(c)