mirror of
https://git.freesoftwareextremist.com/bloat
synced 2024-12-22 17:10:42 +00:00
Show content warning in status
This commit is contained in:
parent
2648484a1d
commit
df875381d4
2 changed files with 5 additions and 2 deletions
|
@ -84,7 +84,10 @@ func EmojiFilter(content string, emojis []mastodon.Emoji) string {
|
|||
return strings.NewReplacer(replacements...).Replace(content)
|
||||
}
|
||||
|
||||
func StatusContentFilter(content string, emojis []mastodon.Emoji, mentions []mastodon.Mention) string {
|
||||
func StatusContentFilter(spoiler string, content string, emojis []mastodon.Emoji, mentions []mastodon.Mention) string {
|
||||
if len(spoiler) > 0 {
|
||||
content = spoiler + "<br />" + content
|
||||
}
|
||||
var replacements []string
|
||||
for _, e := range emojis {
|
||||
replacements = append(replacements, ":"+e.ShortCode+":", "<img class=\"status-emoji\" src=\""+e.URL+"\" alt=\""+e.ShortCode+"\" />")
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="status-content"> {{StatusContentFilter .Content .Emojis .Mentions}} </div>
|
||||
<div class="status-content"> {{StatusContentFilter .SpoilerText .Content .Emojis .Mentions}} </div>
|
||||
<div class="status-media-container">
|
||||
{{range .MediaAttachments}}
|
||||
{{if eq .Type "image"}}
|
||||
|
|
Loading…
Reference in a new issue