Finish reply processing

This commit is contained in:
Thomas Sileo 2019-09-05 23:16:11 +02:00
parent 108850cd4b
commit b6e55dd647
3 changed files with 5 additions and 6 deletions

View file

@ -597,7 +597,10 @@ def task_process_reply() -> _Response:
else: else:
reply_actor = new_replies[new_reply_idx + 1].get_actor() reply_actor = new_replies[new_reply_idx + 1].get_actor()
is_in_reply_to_self = actor.id == reply_actor.id is_in_reply_to_self = actor.id == reply_actor.id
reply_flags = {MetaKey.IN_REPLY_TO_SELF.value: is_in_reply_to_self} reply_flags = {
MetaKey.IN_REPLY_TO_SELF.value: is_in_reply_to_self,
MetaKey.IN_REPLY_TO.value: new_reply.get_in_reply_to(),
}
if not is_in_reply_to_self: if not is_in_reply_to_self:
reply_flags[MetaKey.IN_REPLY_TO_ACTOR.value] = reply_actor.to_dict( reply_flags[MetaKey.IN_REPLY_TO_ACTOR.value] = reply_actor.to_dict(
embed=True embed=True

View file

@ -763,10 +763,7 @@ def handle_replies(create: ap.Create) -> None:
) )
return None return None
in_reply_to_data = { in_reply_to_data = {MetaKey.IN_REPLY_TO: in_reply_to}
MetaKey.IN_REPLY_TO: in_reply_to,
MetaKey.IN_REPLY_TO_URL: reply.get_url(),
}
# Update the activity to save some data about the reply # Update the activity to save some data about the reply
if reply.get_actor().id == create.get_actor().id: if reply.get_actor().id == create.get_actor().id:
in_reply_to_data.update({MetaKey.IN_REPLY_TO_SELF: True}) in_reply_to_data.update({MetaKey.IN_REPLY_TO_SELF: True})

View file

@ -55,7 +55,6 @@ class MetaKey(Enum):
THREAD_ROOT_PARENT = "thread_root_parent" THREAD_ROOT_PARENT = "thread_root_parent"
IN_REPLY_TO = "in_reply_to" IN_REPLY_TO = "in_reply_to"
IN_REPLY_TO_URL = "in_reply_to_url"
IN_REPLY_TO_SELF = "in_reply_to_self" IN_REPLY_TO_SELF = "in_reply_to_self"
IN_REPLY_TO_ACTOR = "in_reply_to_actor" IN_REPLY_TO_ACTOR = "in_reply_to_actor"