From e173f4d0024f7e7f4c4e5d62c6534d30f56ad751 Mon Sep 17 00:00:00 2001 From: Romain de Laage Date: Mon, 1 Mar 2021 19:00:22 +0100 Subject: [PATCH] Add link to thread and to profile --- server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 8e05842..5a1e8a2 100644 --- a/server.go +++ b/server.go @@ -238,7 +238,7 @@ func printProfile(conn *tls.Conn, baseURL, profileID string) { text := removeHTMLTags(blog.Content) + "\n" - _, err = fmt.Fprintf(conn, date + text) + _, err = fmt.Fprintf(conn, date + text + "=> /thread/" + blog.Id + " View the thread\n") if err != nil { log.Println("read blogs: %s", err) return @@ -282,7 +282,7 @@ func printThread(conn *tls.Conn, baseURL, tootID string) { // Print each anscestor for _, toot := range thread.Ancestors { - _, err = fmt.Fprintf(conn, "\n```\n* Posted on " + toot.Date + " by " + toot.Author.Name + " *\n```\n" + removeHTMLTags(toot.Content) + "\n") + _, err = fmt.Fprintf(conn, "\n```\n* Posted on " + toot.Date + " by " + toot.Author.Name + " *\n```\n" + removeHTMLTags(toot.Content) + "\n=> /profile/" + toot.Author.Id + " More toots from " + toot.Author.Name + "\n") if err != nil { log.Println("handleConn: %s", err) return @@ -290,7 +290,7 @@ func printThread(conn *tls.Conn, baseURL, tootID string) { } // Print original toot - _, err = fmt.Fprintf(conn, "\n# Toot\n\n```\n* Posted on " + originalToot.Date + " by "+ originalToot.Author.Name +" *\n```\n" + removeHTMLTags(originalToot.Content) + "\n") + _, err = fmt.Fprintf(conn, "\n# Toot\n\n```\n* Posted on " + originalToot.Date + " by "+ originalToot.Author.Name +" *\n```\n" + removeHTMLTags(originalToot.Content) + "\n=> /profile/" + originalToot.Author.Id + " More toots from " + originalToot.Author.Name + "\n") if err != nil { log.Println("handleConn: %s", err) return @@ -303,7 +303,7 @@ func printThread(conn *tls.Conn, baseURL, tootID string) { return } for _, toot := range thread.Descendants { - _, err = fmt.Fprintf(conn, "\n```\n* Posted on " + toot.Date + " by " + toot.Author.Name + " *\n```\n" + removeHTMLTags(toot.Content) + "\n") + _, err = fmt.Fprintf(conn, "\n```\n* Posted on " + toot.Date + " by " + toot.Author.Name + " *\n```\n" + removeHTMLTags(toot.Content) + "\n=> /profile/" + toot.Author.Id + " More toots from " + toot.Author.Name + "\n") if err != nil { log.Println("handleConn: %s", err) return