From d5003b51a4ca7ed2c13ffd23b051ea31c8836ba0 Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Thu, 18 Nov 2021 23:25:50 -0400 Subject: board/thread view; images don't work --- client.go | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index d4462d7..dfce517 100644 --- a/client.go +++ b/client.go @@ -169,35 +169,20 @@ func ParseLinkComments(board activitypub.Actor, op string, content string, threa } } - //replace link with quote format - replyID, isReply, err := db.IsReplyToOP(op, parsedLink) - if err != nil { - return "", err - } - - if isReply { + if replyID, isReply, err := db.IsReplyToOP(op, parsedLink); err == nil || !isReply { id := util.ShortURL(board.Outbox, replyID) content = strings.Replace(content, match[i][0], ">>"+id+""+isOP+"", -1) - } else { //this is a cross post parsedOP, err := db.GetReplyOP(parsedLink) - if err != nil { - return "", err - } - - actor, err := webfinger.FingerActor(parsedLink) - if err != nil { - return "", err - } - - if parsedOP != "" { + if err == nil { link = parsedOP + "#" + util.ShortURL(parsedOP, parsedLink) } - if actor.Id != "" { + actor, err := webfinger.FingerActor(parsedLink) + if err == nil && actor.Id != "" { content = strings.Replace(content, match[i][0], ">>"+util.ShortURL(board.Outbox, parsedLink)+isOP+" →", -1) } } -- cgit v1.2.3