aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go23
1 files changed, 4 insertions, 19 deletions
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], "<a class=\"reply\" title=\""+quoteTitle+"\" href=\"/"+board.Name+"/"+util.ShortURL(board.Outbox, op)+"#"+id+"\">&gt;&gt;"+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+"\">&gt;&gt;"+util.ShortURL(board.Outbox, parsedLink)+isOP+" →</a>", -1)
}
}