dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 187a1897e082c6e5a61a7059a818eb9badfa90e7
parent a9b17aa1087dbeaaf5b4110cb7a0f57c237c6e46
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat,  3 Jun 2023 05:01:42 -0700

simplify code

Diffstat:
Mpkg/web/handlers/api/v1/topBarHandler.go | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/pkg/web/handlers/api/v1/topBarHandler.go b/pkg/web/handlers/api/v1/topBarHandler.go @@ -1040,17 +1040,14 @@ func convertLinks(in string, var label, href, trimmed string if hasLocalPrefix { trimmed = strings.TrimPrefix(link, dkfLocalPrefix) - label = dkfShortPrefix + trimmed - href = trimmed } else if hasDkfLongPrefix { trimmed = strings.TrimPrefix(link, dkfLongPrefix) - label = dkfShortPrefix + trimmed - href = trimmed } else if hasDkfShortPrefix { trimmed = strings.TrimPrefix(link, dkfShortPrefix) - label = link - href = trimmed } + label = dkfShortPrefix + trimmed + href = trimmed + // Shorten archive links if m := dkfArchiveRgx.FindStringSubmatch(label); len(m) == 3 { if msg, err := getChatMessageByUUID(m[2]); err == nil { if roomID == msg.RoomID {