aboutsummaryrefslogtreecommitdiff
path: root/routes/archive.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-22 14:08:36 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commita66b676481d273508927e64a22e388dc302890ba (patch)
tree7c67b04dd8b39125526567ae6f08a39d0346d260 /routes/archive.go
parent6a0f664b565716ad08301e7699d6c0393dbba977 (diff)
route organization
Diffstat (limited to 'routes/archive.go')
-rw-r--r--routes/archive.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/routes/archive.go b/routes/archive.go
deleted file mode 100644
index c4950b4..0000000
--- a/routes/archive.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package routes
-
-import (
- "github.com/FChannel0/FChannel-Server/activitypub"
- "github.com/FChannel0/FChannel-Server/config"
- "github.com/FChannel0/FChannel-Server/post"
- "github.com/FChannel0/FChannel-Server/util"
- "github.com/FChannel0/FChannel-Server/webfinger"
- "github.com/gofiber/fiber/v2"
-)
-
-func ArchiveGet(ctx *fiber.Ctx) error {
- collection := ctx.Locals("collection").(activitypub.Collection)
- actor := collection.Actor
-
- var returnData PageData
- returnData.Board.Name = actor.Name
- returnData.Board.PrefName = actor.PreferredUsername
- returnData.Board.InReplyTo = ""
- returnData.Board.To = actor.Outbox
- returnData.Board.Actor = actor
- returnData.Board.Summary = actor.Summary
- returnData.Board.ModCred, _ = util.GetPasswordFromSession(ctx)
- returnData.Board.Domain = config.Domain
- returnData.Board.Restricted = actor.Restricted
- returnData.Key = config.Key
- returnData.ReturnTo = "archive"
-
- returnData.Board.Post.Actor = actor.Id
-
- var err error
- returnData.Instance, err = activitypub.GetActorFromDB(config.Domain)
-
- capt, err := util.GetRandomCaptcha()
- if err != nil {
- return util.MakeError(err, "ArchiveGet")
- }
- returnData.Board.Captcha = config.Domain + "/" + capt
- returnData.Board.CaptchaCode = post.GetCaptchaCode(returnData.Board.Captcha)
-
- returnData.Title = "/" + actor.Name + "/ - " + actor.PreferredUsername
-
- returnData.Boards = webfinger.Boards
-
- returnData.Posts = collection.OrderedItems
-
- returnData.Themes = &config.Themes
- returnData.ThemeCookie = getThemeCookie(ctx)
-
- return ctx.Render("archive", fiber.Map{
- "page": returnData,
- }, "layouts/main")
-}