From 752f16f335b73c3d2514eb7663a63fec4dd37894 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 20 Nov 2020 12:20:34 +0000 Subject: [PATCH] Check for self-following --- webapp_profile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/webapp_profile.py b/webapp_profile.py index e691ee96e..8cb4efdfc 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -230,8 +230,15 @@ def htmlProfileAfterSearch(cssCache: {}, if port != 80 and port != 443: domainFull = domain + ':' + str(port) - # only show follow and view buttons if this is not the news actor - if not (searchNickname == 'news' and searchDomainFull == domainFull): + followIsPermitted = True + if searchNickname == 'news' and searchDomainFull == domainFull: + # currently the news actor is not something you can follow + followIsPermitted = False + elif searchNickname == nickname and searchDomainFull == domainFull: + # don't follow yourself! + followIsPermitted = False + + if followIsPermitted: profileStr += '
\n' profileStr += '
\n'