From cefbbe7c5fe3f33ed5248b96f2990d226b107942 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 16 Sep 2019 11:10:26 +0100 Subject: return content warning from ap_utils.format_note and show it closes #118 --- modules/fediverse/ap_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/fediverse/ap_utils.py') diff --git a/modules/fediverse/ap_utils.py b/modules/fediverse/ap_utils.py index a71692ed..d15ff243 100644 --- a/modules/fediverse/ap_utils.py +++ b/modules/fediverse/ap_utils.py @@ -67,13 +67,14 @@ def format_note(actor, note): retooted_user = "@%s@%s" % (original_tooter.username, retoot_instance) retoot_content = utils.http.strip_html(retoot.data["content"]) - return "%s (boost %s): %s - %s" % ( - actor.username, retooted_user, retoot_content), retoot_url + return (retoot.data.get("summary", None), "%s (boost %s): %s - %s" % ( + actor.username, retooted_user, retoot_content), retoot_url) elif note["type"] == "Create": content = utils.http.strip_html(note["object"]["content"]) url = note["object"]["id"] - return "%s: %s" % (actor.username, content), url + return (note["object"].get("summary", None), + "%s: %s" % (actor.username, content), url) - return None, None + return None, None, None -- cgit v1.3.1-10-gc9f91