Updated compose function for toots

This commit is contained in:
Manuel Cortez 2022-11-08 08:59:09 -06:00
parent 6f69426f03
commit 12046c1f56
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -13,10 +13,13 @@ def compose_toot(toot, db, relative_times, show_screen_names):
else: else:
ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale="es") ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale="es")
if toot.reblog != None: if toot.reblog != None:
text = "RT @{}: {}".format(toot.reblog.account.acct, utils.html_filter(toot.reblog.content)) text = _("Boosted from @{}: {}").format(toot.reblog.account.acct, utils.html_filter(toot.reblog.content))
else: else:
text = utils.html_filter(toot.content) text = utils.html_filter(toot.content)
source = toot.get("application", "") source = toot.get("application", "")
if source != "": # "" means remote user, None for legacy apps so we should cover both sides.
if source != None and source != "":
source = source.get("name", "") source = source.get("name", "")
else:
source = ""
return [user+", ", text, ts+", ", source] return [user+", ", text, ts+", ", source]