From c7f257380d78efd7443db5a1b87d5b2075b31694 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 28 Jan 2022 11:08:30 +0000 Subject: [PATCH] Include summaryMap in new posts --- posts.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 4cb6abf95..781134d44 100644 --- a/posts.py +++ b/posts.py @@ -638,7 +638,10 @@ def _get_posts(session, outbox_url: str, max_posts: int, print('max emojis reached') continue - if this_item.get('summary'): + if this_item.get('summaryMap'): + if this_item['summaryMap'].get(system_language): + summary = this_item['summaryMap'][system_language] + if not summary and this_item.get('summary'): if this_item['summary']: summary = this_item['summary'] @@ -1119,6 +1122,9 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int, 'conversation': conversation_id, 'type': post_object_type, 'summary': summary, + 'summaryMap': { + system_language: summary + }, 'inReplyTo': in_reply_to, 'published': published, 'url': new_post_url, @@ -1185,6 +1191,9 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int, 'conversation': conversation_id, 'type': post_object_type, 'summary': summary, + 'summaryMap': { + system_language: summary + }, 'inReplyTo': in_reply_to, 'published': published, 'url': new_post_url, @@ -1719,6 +1728,9 @@ def get_pinned_post_as_json(base_dir: str, http_prefix: str, 'replies': {}, 'sensitive': False, 'summary': None, + 'summaryMap': { + system_language: None + }, 'tag': [], 'to': ['https://www.w3.org/ns/activitystreams#Public'], 'type': 'Note',