Fix reply content with mentions

This commit is contained in:
Thomas Sileo
2019-10-27 12:41:33 +01:00
parent ba1bfe4943
commit d3f9e72801
3 changed files with 13 additions and 4 deletions

View File

@@ -345,6 +345,16 @@ def admin_new() -> _Response:
domain = urlparse(actor.id).netloc
# FIXME(tsileo): if reply of reply, fetch all participants
content = f"@{actor.preferredUsername}@{domain} "
if reply.has_type(ap.ActivityType.CREATE):
reply = reply.get_object()
for mention in reply.get_mentions():
if mention.href in [actor.id, ID]:
continue
m = ap.fetch_remote_activity(mention.href)
if m.has_type(ap.ACTOR_TYPES):
d = urlparse(m.id).netloc
content += f"@{m.preferredUsername}@{d} "
thread = _build_thread(data)
return htmlify(