diff options
author | r <r@freesoftwareextremist.com> | 2024-06-17 11:41:02 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2024-06-17 11:41:02 +0000 |
commit | 61c166b79570219a515bb3b8dd344a403708b371 (patch) | |
tree | 81d2ebb603d86d3b7c3580de46a25c5acc4af224 /renderer | |
parent | ce1680dfd050990d8f3e484b92eb0db350bc3f2c (diff) | |
download | bloat-61c166b79570219a515bb3b8dd344a403708b371.tar.gz bloat-61c166b79570219a515bb3b8dd344a403708b371.zip |
Show quoted posts
Diffstat (limited to 'renderer')
-rw-r--r-- | renderer/renderer.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/renderer/renderer.go b/renderer/renderer.go index a88bb9e..e97fee4 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -68,6 +68,17 @@ func statusContentFilter(content string, emojis []mastodon.Emoji, mentions []mas return strings.NewReplacer(replacements...).Replace(content) } +func getQuote(s *mastodon.Status) *mastodon.Status { + if s.Pleroma.Quote == nil || !s.Pleroma.QuoteVisible { + return nil + } + q := s.Pleroma.Quote + q.RetweetedByID = s.ID + // Disable nested quotes + q.Pleroma.QuoteVisible = false + return q +} + func displayInteractionCount(c int64) string { if c > 0 { return strconv.Itoa(int(c)) @@ -145,6 +156,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) { t, err = t.Funcs(template.FuncMap{ "EmojiFilter": emojiFilter, "StatusContentFilter": statusContentFilter, + "GetQuote": getQuote, "DisplayInteractionCount": displayInteractionCount, "TimeSince": timeSince, "TimeUntil": timeUntil, |