From 87784a816678be2b4dfa2a5367a89f21e947f249 Mon Sep 17 00:00:00 2001 From: Romain de Laage Date: Wed, 11 May 2022 15:28:11 +0200 Subject: [PATCH] Hotfix: Reblog content were not visible --- main.go | 7 +------ util.go | 7 ++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index cbd1118..5f814f4 100644 --- a/main.go +++ b/main.go @@ -22,11 +22,6 @@ import ( "time" ) -type OriginalBlog struct { - Id string `json:"id"` - Author Account `json:"account"` -} - type Blog struct { Id string `json:"id"` Content string `json:"content"` @@ -34,7 +29,7 @@ type Blog struct { Author Account `json:"account"` Tags []Tag `json:"tags"` Mentions []Mention `json:"mentions"` - Reblog *OriginalBlog `json:"reblog"` + Reblog *Blog `json:"reblog"` Medias []Media `json:"media_attachments"` } diff --git a/util.go b/util.go index 4a0d337..5998b3b 100644 --- a/util.go +++ b/util.go @@ -89,7 +89,12 @@ func removeHTMLTags(content string) string { } func formatBlog(toot Blog) string { - content := toot.Content + var content string + if toot.Reblog == nil { + content = toot.Content + } else { + content = toot.Reblog.Content + } content = removeHTMLTags(content) content = strings.Trim(content, " \n\r") content = strings.ReplaceAll(content, "\n#", "\n[#]")