Fix reply content with mentions
This commit is contained in:
parent
ba1bfe4943
commit
d3f9e72801
3 changed files with 13 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue