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) }}