From abff9dee9cc1d381e744fe89c8186ef1b259c713 Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Tue, 19 Sep 2023 13:49:09 +0100
Subject: [PATCH] Show mutuals on profile after search
---
webapp_profile.py | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/webapp_profile.py b/webapp_profile.py
index 69138c1d1..b8531c87d 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -290,6 +290,10 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
moved_to = remove_html(moved_to)
display_name += ' ⌂'
+ you_follow = \
+ is_following_actor(base_dir,
+ nickname, domain, person_url)
+
follows_you = \
is_follower_of_person(base_dir,
nickname, domain,
@@ -379,7 +383,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
search_nickname,
search_domain_full,
translate,
- display_name, follows_you,
+ display_name,
+ you_follow, follows_you,
profile_description_short,
featured_hashtags,
avatar_url, image_url,
@@ -419,7 +424,7 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
profile_str += \
' \n'
- if not is_following_actor(base_dir, nickname, domain, person_url):
+ if not you_follow:
if is_moderator(base_dir, nickname):
profile_str += \
'
\n'
if follows_you:
- html_str += ' ' + translate['Follows you'] + '
\n'
+ if not you_follow:
+ html_str += ' ' + \
+ translate['Follows you'] + '
\n'
+ else:
+ html_str += ' ' + \
+ translate['Mutuals'] + '
\n'
if send_blocks_str:
html_str += ' ' + send_blocks_str + '
\n'
if moved_to: