improve DMs + add rebuild script

main
Dominik Madarász 2023-01-12 14:49:37 +00:00
parent 869ed215a3
commit 7cb1f8196e
3 changed files with 13 additions and 2 deletions

View File

@ -587,9 +587,11 @@ async def admin_direct_messages(
)
).scalars()
)
has_actors = True
# If this message from outbox starts a thread with no replies, look
# at the mentions
if not actors and anybox_object.is_from_outbox:
has_actors = False
actors = ( # type: ignore
await db_session.execute(
select(models.Actor).where(
@ -601,7 +603,7 @@ async def admin_direct_messages(
)
)
).scalars()
threads.append((anybox_object, convo, actors))
threads.append((anybox_object, convo, actors, has_actors))
return await templates.render_template(
db_session,

View File

@ -7,13 +7,15 @@
{% block content %}
{% for anybox_object, convo, actors in threads %}
{% for anybox_object, convo, actors, has_actors in threads %}
<div class="actor-action">
{% if has_actors %}
With {% for actor in actors %}
<a href="{{ url_for("admin_profile") }}?actor_id={{ actor.ap_id }}">
{{ actor.handle }}
</a>
{% endfor %}
{% endif %}
</div>
{{ utils.display_object(anybox_object) }}
{% endfor %}

7
rebuild.sh 100755
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -xe
sudo docker compose build
sudo docker compose down
sudo docker compose up -d