Include summaryMap in new posts

main
Bob Mottram 2022-01-28 11:08:30 +00:00
parent eb20a723b3
commit c7f257380d
1 changed files with 13 additions and 1 deletions

View File

@ -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',