diff options
author | FChannel <> | 2022-05-08 14:57:40 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 580dec5b89215310ce34341e11ff17fe38bdb63a (patch) | |
tree | 894424df66a9d9f7e41805822f29adac8fb490fe /routes/archive.go | |
parent | f7bf818d29393ceaccf4d2906557351fa6a4f49f (diff) |
more cleanup, logging and error logging everywhere
things are mostly in place can work on "features" and polish
Diffstat (limited to 'routes/archive.go')
-rw-r--r-- | routes/archive.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/routes/archive.go b/routes/archive.go index c0f4ff6..c4950b4 100644 --- a/routes/archive.go +++ b/routes/archive.go @@ -3,14 +3,13 @@ package routes import ( "github.com/FChannel0/FChannel-Server/activitypub" "github.com/FChannel0/FChannel-Server/config" - "github.com/FChannel0/FChannel-Server/db" + "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 { - // TODO collection := ctx.Locals("collection").(activitypub.Collection) actor := collection.Actor @@ -21,7 +20,7 @@ func ArchiveGet(ctx *fiber.Ctx) error { returnData.Board.To = actor.Outbox returnData.Board.Actor = actor returnData.Board.Summary = actor.Summary - returnData.Board.ModCred, _ = db.GetPasswordFromSession(ctx) + returnData.Board.ModCred, _ = util.GetPasswordFromSession(ctx) returnData.Board.Domain = config.Domain returnData.Board.Restricted = actor.Restricted returnData.Key = config.Key @@ -32,12 +31,12 @@ func ArchiveGet(ctx *fiber.Ctx) error { var err error returnData.Instance, err = activitypub.GetActorFromDB(config.Domain) - capt, err := db.GetRandomCaptcha() + capt, err := util.GetRandomCaptcha() if err != nil { - return err + return util.MakeError(err, "ArchiveGet") } returnData.Board.Captcha = config.Domain + "/" + capt - returnData.Board.CaptchaCode = util.GetCaptchaCode(returnData.Board.Captcha) + returnData.Board.CaptchaCode = post.GetCaptchaCode(returnData.Board.Captcha) returnData.Title = "/" + actor.Name + "/ - " + actor.PreferredUsername |