diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-11-18 23:25:50 -0400 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | d5003b51a4ca7ed2c13ffd23b051ea31c8836ba0 (patch) | |
tree | a47593f1764f199ce0fdf186aae7d55d2816516a /client.go | |
parent | d1c8716c3e1eebde7e028ff675120854320a714a (diff) |
board/thread view; images don't work
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -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], "<a class=\"reply\" title=\""+quoteTitle+"\" href=\"/"+board.Name+"/"+util.ShortURL(board.Outbox, op)+"#"+id+"\">>>"+id+""+isOP+"</a>", -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], "<a class=\"reply\" title=\""+quoteTitle+"\" href=\""+link+"\">>>"+util.ShortURL(board.Outbox, parsedLink)+isOP+" →</a>", -1) } } |