Fix boosted notifications

This commit is contained in:
Andrew Godwin 2022-11-22 18:59:51 -07:00
parent e52c7df498
commit 48154fb20e
2 changed files with 13 additions and 1 deletions

View File

@ -40,6 +40,13 @@ class PostInteractionStates(StateGraph):
subject_post=interaction.post, subject_post=interaction.post,
subject_post_interaction=interaction, subject_post_interaction=interaction,
) )
# And one to the post's author
await FanOut.objects.acreate(
type=FanOut.Types.interaction,
identity_id=interaction.post.author_id,
subject_post=interaction.post,
subject_post_interaction=interaction,
)
# Like: send a copy to the original post author only # Like: send a copy to the original post author only
elif interaction.type == interaction.Types.like: elif interaction.type == interaction.Types.like:
await FanOut.objects.acreate( await FanOut.objects.acreate(

View File

@ -22,7 +22,12 @@
</div> </div>
{% include "activities/_post.html" with post=event.subject_post %} {% include "activities/_post.html" with post=event.subject_post %}
{% elif event.type == "boosted" %} {% elif event.type == "boosted" %}
{{ event.subject_identity.name_or_handle }} boosted your post {{ event.subject_post }} <div class="boost-banner">
<a href="{{ event.subject_identity.urls.view }}">
{{ event.subject_identity.name_or_handle }}
</a> boosted your post
</div>
{% include "activities/_post.html" with post=event.subject_post %}
{% else %} {% else %}
Unknown event type {{event.type}} Unknown event type {{event.type}}
{% endif %} {% endif %}