Fix mentions when replying

main
Thomas Sileo 2022-07-28 08:41:50 +02:00
parent 98d5cf32c8
commit 241cc1433b
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ from app import boxes
from app import models
from app import templates
from app.actor import LOCAL_ACTOR
from app.actor import fetch_actor
from app.actor import get_actors_metadata
from app.boxes import get_inbox_object_by_ap_id
from app.boxes import get_outbox_object_by_ap_id
@ -148,7 +149,8 @@ async def admin_new(
content += f"{in_reply_to_object.actor.handle} "
for tag in in_reply_to_object.tags:
if tag.get("type") == "Mention" and tag["name"] != LOCAL_ACTOR.handle:
content += f'{tag["name"]} '
mentioned_actor = await fetch_actor(db_session, tag["href"])
content += f"{mentioned_actor.handle} "
return await templates.render_template(
db_session,