Also list followers

main
Bob Mottram 2022-07-19 14:31:13 +01:00
parent 297f25f92c
commit 5d2b7c40f9
2 changed files with 31 additions and 1 deletions

View File

@ -16393,6 +16393,32 @@ class PubServer(BaseHTTPRequestHandler):
'_GET', 'following accounts done',
self.server.debug)
# show a list of who are your followers
if html_getreq and authorized and users_in_path and \
self.path.endswith('/followersaccounts'):
nickname = get_nickname_from_actor(self.path)
if not nickname:
self._404()
return
followers_filename = \
acct_dir(self.server.base_dir,
nickname, self.server.domain) + '/followers.txt'
if not os.path.isfile(followers_filename):
self._404()
return
msg = html_following_list(self.server.base_dir, followers_filename)
msglen = len(msg)
self._login_headers('text/html', msglen, calling_domain)
self._write(msg.encode('utf-8'))
fitness_performance(getreq_start_time, self.server.fitness,
'_GET', 'followers accounts shown',
self.server.debug)
return
fitness_performance(getreq_start_time, self.server.fitness,
'_GET', 'followers accounts done',
self.server.debug)
if self.path.endswith('/about'):
if calling_domain.endswith('.onion'):
msg = \

View File

@ -1998,7 +1998,11 @@ def _html_edit_profile_contact_info(nickname: str,
edit_profile_form += \
'<a href="/users/' + nickname + \
'/followingaccounts"><label class="labels">' + \
translate['Following'] + '</label></a><br>\n'
translate['Following'] + '</label></a> '
edit_profile_form += \
'<a href="/users/' + nickname + \
'/followersaccounts"><label class="labels">' + \
translate['Followers'] + '</label></a><br>\n'
edit_profile_form += end_edit_section()
return edit_profile_form