From 9332b348eb27df2dbcdf59595ec252f5d28bb426 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 1 Jul 2018 21:32:12 +0200 Subject: [PATCH] Bugfix template --- app.py | 5 +++++ templates/stream.html | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 63ca676..aced9f0 100644 --- a/app.py +++ b/app.py @@ -994,6 +994,10 @@ def notifications(): "activity.object": {"$regex": f"^{BASE_URL}"}, } new_followers_query = {"type": ActivityType.FOLLOW.value} + unfollow_query = { + "type": ActivityType.UNDO.value, + "activity.object.type": ActivityType.FOLLOW.value, + } followed_query = {"type": ActivityType.ACCEPT.value} q = { "box": Box.INBOX.value, @@ -1003,6 +1007,7 @@ def notifications(): replies_query, new_followers_query, followed_query, + unfollow_query, ], } c = request.args.get("cursor") diff --git a/templates/stream.html b/templates/stream.html index d900d3f..f5c42a6 100644 --- a/templates/stream.html +++ b/templates/stream.html @@ -21,13 +21,19 @@ {% endif %} {% if item | has_type('Follow') %} -

new follower +

new follower

{{ utils.display_actor_inline(item.activity.actor | get_actor, size=50) }}
{% elif item | has_type('Accept') %} -

you started following

+

you started following

+
+ {{ utils.display_actor_inline(item.activity.actor | get_actor, size=50) }} +
+ + {% elif item | has_type('Undo') %} +

unfollowed you

{{ utils.display_actor_inline(item.activity.actor | get_actor, size=50) }}