From 0accfaea3986244bdc25edf334fb17928f23a5de Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 2 Jan 2021 12:00:07 +0000 Subject: [PATCH] Show follows you status on profile after search --- webapp_profile.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webapp_profile.py b/webapp_profile.py index eb02b0b9..65d29a59 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -38,6 +38,7 @@ from tox import getToxAddress from briar import getBriarAddress from jami import getJamiAddress from filters import isFiltered +from follow import isFollowerOfPerson from webapp_frontscreen import htmlFrontScreen from webapp_utils import scheduledPostsExist from webapp_utils import getPersonAvatarUrl @@ -170,6 +171,12 @@ def htmlProfileAfterSearch(cssCache: {}, if lockedAccount: displayName += '🔒' + followsYou = \ + isFollowerOfPerson(baseDir, + nickname, domain, + searchNickname, + searchDomainFull) + profileDescription = '' if profileJson.get('summary'): profileDescription = profileJson['summary'] @@ -224,7 +231,7 @@ def htmlProfileAfterSearch(cssCache: {}, searchNickname, searchDomainFull, translate, - displayName, + displayName, followsYou, profileDescriptionShort, avatarUrl, imageUrl) @@ -330,6 +337,7 @@ def _getProfileHeaderAfterSearch(baseDir: str, searchDomainFull: str, translate: {}, displayName: str, + followsYou: bool, profileDescriptionShort: str, avatarUrl: str, imageUrl: str) -> str: """The header of a searched for handle, containing background @@ -352,6 +360,8 @@ def _getProfileHeaderAfterSearch(baseDir: str, htmlStr += '

' + displayName + '

\n' htmlStr += \ '

@' + searchNickname + '@' + searchDomainFull + '
\n' + if followsYou: + htmlStr += '

' + translate['Follows you'] + '

\n' htmlStr += '

' + profileDescriptionShort + '

\n' htmlStr += ' \n' htmlStr += ' \n\n'