From 3007790bf68fdb31808e3391d8a3a22ca68561a6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 17 Jun 2020 17:48:58 +0100 Subject: [PATCH] Endpoint for showing a list of accounts which you are following --- daemon.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/daemon.py b/daemon.py index bc6ec9e2..dad257ac 100644 --- a/daemon.py +++ b/daemon.py @@ -1559,6 +1559,23 @@ class PubServer(BaseHTTPRequestHandler): self._benchmarkGETtimings(GETstartTime, GETtimings, 11) + # show a list of who you are following + if htmlGET and authorized and '/users/' in self.path and \ + self.path.endswith('/following'): + nickname = getNicknameFromActor(self.path) + followingFilename = \ + self.baseDir + '/accounts/' + \ + nickname + '@' + self.domain + '/following.txt' + if not os.path.isfile(followingFilename): + self._404() + return + msg = '' + with open(followingFilename, 'r') as followingFile: + msg = followingFile.read() + self._login_headers('text/plain', len(msg), callingDomain) + self._write(msg.encode('utf-8')) + return + if self.path.startswith('/about'): if callingDomain.endswith('.onion'): msg = \