Added content warnings to templates as $safe_text. Content warnings will be shown by default on GUI for now

This commit is contained in:
2022-11-10 15:32:49 -06:00
parent d6985be896
commit 3deffa57de
4 changed files with 18 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import arrow
from . import utils
from . import utils, templates
def compose_toot(toot, db, relative_times, show_screen_names):
if show_screen_names == False:
@@ -15,9 +15,9 @@ def compose_toot(toot, db, relative_times, show_screen_names):
else:
ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale="es")
if toot.reblog != None:
text = _("Boosted from @{}: {}").format(toot.reblog.account.acct, utils.html_filter(toot.reblog.content))
text = _("Boosted from @{}: {}").format(toot.reblog.account.acct, templates.process_text(toot.reblog))
else:
text = utils.html_filter(toot.content)
text = templates.process_text(toot)
source = toot.get("application", "")
# "" means remote user, None for legacy apps so we should cover both sides.
if source != None and source != "":