From c55ecac34d8acf5b33d0883cae5e4e9ca01470ba Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 22 Jan 2021 14:03:09 +0000 Subject: [PATCH] Dummy endpoints for masto api followers and following --- daemon.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 2fdc2ce9f..83170ada7 100644 --- a/daemon.py +++ b/daemon.py @@ -813,8 +813,18 @@ class PubServer(BaseHTTPRequestHandler): if mastoId is not None: pathNickname = getNicknameFromMastoApiV1Id(mastoId) if pathNickname: - sendJson = getMastoApiV1Account(baseDir, pathNickname, domain) - sendJsonStr = 'masto API account sent for ' + nickname + if '/followers?' in path or '/following?' in path: + path = path.split('?')[0] + if path.endswith('/followers'): + sendJson = [] + sendJsonStr = 'masto API followers sent for ' + nickname + if path.endswith('/following'): + sendJson = [] + sendJsonStr = 'masto API following sent for ' + nickname + else: + sendJson = \ + getMastoApiV1Account(baseDir, pathNickname, domain) + sendJsonStr = 'masto API account sent for ' + nickname adminNickname = getConfigParam(self.server.baseDir, 'admin') if adminNickname and path == '/api/v1/instance':