mirror of https://gitlab.com/bashrc2/epicyon
'context' is sometimes used to mean the same thing as 'conversation'
This does not appear to be part of the AP spec, but is used in the wildmain
parent
40ba283755
commit
86eb346cf7
|
|
@ -910,6 +910,9 @@ def mute_post(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
if post_json_obj.get('conversation'):
|
if post_json_obj.get('conversation'):
|
||||||
mute_conversation(base_dir, nickname, domain,
|
mute_conversation(base_dir, nickname, domain,
|
||||||
post_json_obj['conversation'])
|
post_json_obj['conversation'])
|
||||||
|
elif post_json_obj.get('context'):
|
||||||
|
mute_conversation(base_dir, nickname, domain,
|
||||||
|
post_json_obj['context'])
|
||||||
|
|
||||||
# does this post have ignores on it from differenent actors?
|
# does this post have ignores on it from differenent actors?
|
||||||
if not post_json_obj.get('ignores'):
|
if not post_json_obj.get('ignores'):
|
||||||
|
|
@ -1048,6 +1051,9 @@ def unmute_post(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
if post_json_obj.get('conversation'):
|
if post_json_obj.get('conversation'):
|
||||||
unmute_conversation(base_dir, nickname, domain,
|
unmute_conversation(base_dir, nickname, domain,
|
||||||
post_json_obj['conversation'])
|
post_json_obj['conversation'])
|
||||||
|
elif post_json_obj.get('context'):
|
||||||
|
unmute_conversation(base_dir, nickname, domain,
|
||||||
|
post_json_obj['context'])
|
||||||
|
|
||||||
if post_json_obj.get('ignores'):
|
if post_json_obj.get('ignores'):
|
||||||
domain_full = get_full_domain(domain, port)
|
domain_full = get_full_domain(domain, port)
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,18 @@ def _get_conversation_filename(base_dir: str, nickname: str, domain: str,
|
||||||
"""
|
"""
|
||||||
if not has_object_dict(post_json_object):
|
if not has_object_dict(post_json_object):
|
||||||
return None
|
return None
|
||||||
if not post_json_object['object'].get('conversation'):
|
if not post_json_object['object'].get('conversation') and \
|
||||||
|
not post_json_object['object'].get('context'):
|
||||||
return None
|
return None
|
||||||
if not post_json_object['object'].get('id'):
|
if not post_json_object['object'].get('id'):
|
||||||
return None
|
return None
|
||||||
conversation_dir = acct_dir(base_dir, nickname, domain) + '/conversation'
|
conversation_dir = acct_dir(base_dir, nickname, domain) + '/conversation'
|
||||||
if not os.path.isdir(conversation_dir):
|
if not os.path.isdir(conversation_dir):
|
||||||
os.mkdir(conversation_dir)
|
os.mkdir(conversation_dir)
|
||||||
|
if post_json_object['object'].get('conversation'):
|
||||||
conversation_id = post_json_object['object']['conversation']
|
conversation_id = post_json_object['object']['conversation']
|
||||||
|
else:
|
||||||
|
conversation_id = post_json_object['object']['context']
|
||||||
conversation_id = conversation_id.replace('/', '#')
|
conversation_id = conversation_id.replace('/', '#')
|
||||||
return conversation_dir + '/' + conversation_id
|
return conversation_dir + '/' + conversation_id
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1825,6 +1825,9 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str,
|
||||||
if post_json_object['object'].get('conversation'):
|
if post_json_object['object'].get('conversation'):
|
||||||
conversation_id = \
|
conversation_id = \
|
||||||
post_json_object['object']['conversation']
|
post_json_object['object']['conversation']
|
||||||
|
elif post_json_object['object'].get('context'):
|
||||||
|
conversation_id = \
|
||||||
|
post_json_object['object']['context']
|
||||||
session_reply = create_session(proxy_type)
|
session_reply = create_session(proxy_type)
|
||||||
_desktop_reply_to_post(session_reply, post_id,
|
_desktop_reply_to_post(session_reply, post_id,
|
||||||
base_dir, nickname,
|
base_dir, nickname,
|
||||||
|
|
|
||||||
|
|
@ -911,6 +911,7 @@ def _dav_store_event(base_dir: str, nickname: str, domain: str,
|
||||||
"object": {
|
"object": {
|
||||||
"id": post_id,
|
"id": post_id,
|
||||||
"conversation": post_id,
|
"conversation": post_id,
|
||||||
|
"context": post_id,
|
||||||
"type": "Note",
|
"type": "Note",
|
||||||
"summary": None,
|
"summary": None,
|
||||||
"inReplyTo": None,
|
"inReplyTo": None,
|
||||||
|
|
|
||||||
2
inbox.py
2
inbox.py
|
|
@ -3993,6 +3993,8 @@ def _create_reply_notification_file(base_dir: str, nickname: str, domain: str,
|
||||||
conversation_id = None
|
conversation_id = None
|
||||||
if post_json_object['object'].get('conversation'):
|
if post_json_object['object'].get('conversation'):
|
||||||
conversation_id = post_json_object['object']['conversation']
|
conversation_id = post_json_object['object']['conversation']
|
||||||
|
elif post_json_object['object'].get('context'):
|
||||||
|
conversation_id = post_json_object['object']['context']
|
||||||
|
|
||||||
if not post_json_object['object'].get('inReplyTo'):
|
if not post_json_object['object'].get('inReplyTo'):
|
||||||
return is_reply_to_muted_post
|
return is_reply_to_muted_post
|
||||||
|
|
|
||||||
2
posts.py
2
posts.py
|
|
@ -1126,6 +1126,7 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
'object': {
|
'object': {
|
||||||
'id': new_post_id,
|
'id': new_post_id,
|
||||||
'conversation': conversation_id,
|
'conversation': conversation_id,
|
||||||
|
'context': conversation_id,
|
||||||
'type': post_object_type,
|
'type': post_object_type,
|
||||||
'summary': summary,
|
'summary': summary,
|
||||||
'inReplyTo': in_reply_to,
|
'inReplyTo': in_reply_to,
|
||||||
|
|
@ -1193,6 +1194,7 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int,
|
||||||
"@context": post_context,
|
"@context": post_context,
|
||||||
'id': new_post_id,
|
'id': new_post_id,
|
||||||
'conversation': conversation_id,
|
'conversation': conversation_id,
|
||||||
|
'context': conversation_id,
|
||||||
'type': post_object_type,
|
'type': post_object_type,
|
||||||
'summary': summary,
|
'summary': summary,
|
||||||
'inReplyTo': in_reply_to,
|
'inReplyTo': in_reply_to,
|
||||||
|
|
|
||||||
6
utils.py
6
utils.py
|
|
@ -2032,13 +2032,17 @@ def _delete_conversation_post(base_dir: str, nickname: str, domain: str,
|
||||||
"""
|
"""
|
||||||
if not has_object_dict(post_json_object):
|
if not has_object_dict(post_json_object):
|
||||||
return False
|
return False
|
||||||
if not post_json_object['object'].get('conversation'):
|
if not post_json_object['object'].get('conversation') and \
|
||||||
|
not post_json_object['object'].get('context'):
|
||||||
return False
|
return False
|
||||||
if not post_json_object['object'].get('id'):
|
if not post_json_object['object'].get('id'):
|
||||||
return False
|
return False
|
||||||
conversation_dir = \
|
conversation_dir = \
|
||||||
acct_dir(base_dir, nickname, domain) + '/conversation'
|
acct_dir(base_dir, nickname, domain) + '/conversation'
|
||||||
|
if post_json_object['object'].get('conversation'):
|
||||||
conversation_id = post_json_object['object']['conversation']
|
conversation_id = post_json_object['object']['conversation']
|
||||||
|
else:
|
||||||
|
conversation_id = post_json_object['object']['context']
|
||||||
conversation_id = conversation_id.replace('/', '#')
|
conversation_id = conversation_id.replace('/', '#')
|
||||||
post_id = post_json_object['object']['id']
|
post_id = post_json_object['object']['id']
|
||||||
conversation_filename = conversation_dir + '/' + conversation_id
|
conversation_filename = conversation_dir + '/' + conversation_id
|
||||||
|
|
|
||||||
1
video.py
1
video.py
|
|
@ -150,6 +150,7 @@ def convert_video_to_note(base_dir: str, nickname: str, domain: str,
|
||||||
'object': {
|
'object': {
|
||||||
'id': new_post_id,
|
'id': new_post_id,
|
||||||
'conversation': conversation_id,
|
'conversation': conversation_id,
|
||||||
|
'context': conversation_id,
|
||||||
'type': 'Note',
|
'type': 'Note',
|
||||||
'summary': None,
|
'summary': None,
|
||||||
'inReplyTo': None,
|
'inReplyTo': None,
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,8 @@ def html_new_post(edit_post_params: {},
|
||||||
return ''
|
return ''
|
||||||
if edited_post_json['object'].get('conversation'):
|
if edited_post_json['object'].get('conversation'):
|
||||||
conversation_id = edited_post_json['object']['conversation']
|
conversation_id = edited_post_json['object']['conversation']
|
||||||
|
elif edited_post_json['object'].get('context'):
|
||||||
|
conversation_id = edited_post_json['object']['context']
|
||||||
if edit_post_params.get('replyTo'):
|
if edit_post_params.get('replyTo'):
|
||||||
in_reply_to = edit_post_params['replyTo']
|
in_reply_to = edit_post_params['replyTo']
|
||||||
if edit_post_params['scope'] == 'dm':
|
if edit_post_params['scope'] == 'dm':
|
||||||
|
|
|
||||||
|
|
@ -2177,10 +2177,13 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
||||||
comments_enabled = False
|
comments_enabled = False
|
||||||
|
|
||||||
conversation_id = None
|
conversation_id = None
|
||||||
if isinstance(post_json_object['object'], dict) and \
|
if isinstance(post_json_object['object'], dict):
|
||||||
'conversation' in post_json_object['object']:
|
if 'conversation' in post_json_object['object']:
|
||||||
if post_json_object['object']['conversation']:
|
if post_json_object['object']['conversation']:
|
||||||
conversation_id = post_json_object['object']['conversation']
|
conversation_id = post_json_object['object']['conversation']
|
||||||
|
elif 'context' in post_json_object['object']:
|
||||||
|
if post_json_object['object']['context']:
|
||||||
|
conversation_id = post_json_object['object']['context']
|
||||||
|
|
||||||
public_reply = False
|
public_reply = False
|
||||||
unlisted_reply = False
|
unlisted_reply = False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue