From e80fe14f7985f9e85bfb9582926acd7891455786 Mon Sep 17 00:00:00 2001
From: FChannel <>
Date: Sun, 1 May 2022 12:13:25 -0700
Subject: fix for parsing reply link and showing images in static folder
---
main.go | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
(limited to 'main.go')
diff --git a/main.go b/main.go
index 125369a..bafa0ee 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ 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/routes"
"github.com/FChannel0/FChannel-Server/util"
"github.com/FChannel0/FChannel-Server/webfinger"
@@ -112,6 +113,7 @@ func main() {
app.Use(logger.New())
app.Static("/static", "./views")
+ app.Static("/static", "./static")
app.Static("/public", "./public")
/*
@@ -636,14 +638,9 @@ func TemplateFunctions(engine *html.Engine) {
engine.AddFunc("isOnion", util.IsOnion)
engine.AddFunc("parseReplyLink", func(actorId string, op string, id string, content string) template.HTML {
- actor, err := webfinger.FingerActor(actorId)
- if err != nil {
- // TODO: figure out what to do here
- panic(err)
- }
-
- title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\<`, ">")
- link := fmt.Sprintf(">>%s", actor.Name, util.ShortURL(actor.Outbox, op), util.ShortURL(actor.Outbox, id), title, util.ShortURL(actor.Outbox, id))
+ actor, _ := webfinger.FingerActor(actorId)
+ title := strings.ReplaceAll(post.ParseLinkTitle(actor.Id+"/", op, content), `/\<`, ">")
+ link := ">>" + util.ShortURL(actor.Outbox, id) + ""
return template.HTML(link)
})
--
cgit v1.2.3