Add link to thread and to profile

This commit is contained in:
Romain de Laage 2021-03-01 19:00:22 +01:00
parent c9fabd4967
commit e173f4d002
Signed by: rdelaage
GPG Key ID: 534845FADDF0C329
1 changed files with 4 additions and 4 deletions

View File

@ -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