diff --git a/server.go b/server.go index edc4545..8e05842 100644 --- a/server.go +++ b/server.go @@ -18,9 +18,10 @@ import ( ) type Blog struct { - Id string `json:"id"` - Content string `json:"content"` - Date string `json:"created_at"` + Id string `json:"id"` + Content string `json:"content"` + Date string `json:"created_at"` + Author Account `json:"account"` } type Config struct { @@ -281,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 + " *\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") if err != nil { log.Println("handleConn: %s", err) return @@ -289,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 + " *\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") if err != nil { log.Println("handleConn: %s", err) return @@ -302,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 + " *\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") if err != nil { log.Println("handleConn: %s", err) return