mirror of https://gitlab.com/bashrc2/epicyon
Include summaryMap in new posts
parent
eb20a723b3
commit
c7f257380d
14
posts.py
14
posts.py
|
@ -638,7 +638,10 @@ def _get_posts(session, outbox_url: str, max_posts: int,
|
||||||
print('max emojis reached')
|
print('max emojis reached')
|
||||||
continue
|
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']:
|
if this_item['summary']:
|
||||||
summary = 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,
|
'conversation': conversation_id,
|
||||||
'type': post_object_type,
|
'type': post_object_type,
|
||||||
'summary': summary,
|
'summary': summary,
|
||||||
|
'summaryMap': {
|
||||||
|
system_language: summary
|
||||||
|
},
|
||||||
'inReplyTo': in_reply_to,
|
'inReplyTo': in_reply_to,
|
||||||
'published': published,
|
'published': published,
|
||||||
'url': new_post_url,
|
'url': new_post_url,
|
||||||
|
@ -1185,6 +1191,9 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
'conversation': conversation_id,
|
'conversation': conversation_id,
|
||||||
'type': post_object_type,
|
'type': post_object_type,
|
||||||
'summary': summary,
|
'summary': summary,
|
||||||
|
'summaryMap': {
|
||||||
|
system_language: summary
|
||||||
|
},
|
||||||
'inReplyTo': in_reply_to,
|
'inReplyTo': in_reply_to,
|
||||||
'published': published,
|
'published': published,
|
||||||
'url': new_post_url,
|
'url': new_post_url,
|
||||||
|
@ -1719,6 +1728,9 @@ def get_pinned_post_as_json(base_dir: str, http_prefix: str,
|
||||||
'replies': {},
|
'replies': {},
|
||||||
'sensitive': False,
|
'sensitive': False,
|
||||||
'summary': None,
|
'summary': None,
|
||||||
|
'summaryMap': {
|
||||||
|
system_language: None
|
||||||
|
},
|
||||||
'tag': [],
|
'tag': [],
|
||||||
'to': ['https://www.w3.org/ns/activitystreams#Public'],
|
'to': ['https://www.w3.org/ns/activitystreams#Public'],
|
||||||
'type': 'Note',
|
'type': 'Note',
|
||||||
|
|
Loading…
Reference in New Issue