From 149acb0c4d262d5a0c2333c86eb3cf2962194a28 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 Aug 2020 15:44:50 +0100 Subject: [PATCH] Tidying --- daemon.py | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/daemon.py b/daemon.py index 6b0ddc1a..41df01f5 100644 --- a/daemon.py +++ b/daemon.py @@ -1222,33 +1222,25 @@ class PubServer(BaseHTTPRequestHandler): if loginNickname: self.server.lastLoginTime = int(time.time()) if register: - if not registerAccount(baseDir, - httpPrefix, - domain, - port, - loginNickname, - loginPassword, + if not registerAccount(baseDir, httpPrefix, domain, port, + loginNickname, loginPassword, self.server.manualFollowerApproval): self.server.POSTbusy = False if callingDomain.endswith('.onion') and onionDomain: - self._redirect_headers('http://' + - onionDomain + - '/login', - cookie, callingDomain) + self._redirect_headers('http://' + onionDomain + + '/login', cookie, + callingDomain) elif (callingDomain.endswith('.i2p') and i2pDomain): - self._redirect_headers('http://' + - i2pDomain + - '/login', - cookie, callingDomain) + self._redirect_headers('http://' + i2pDomain + + '/login', cookie, + callingDomain) else: - self._redirect_headers(httpPrefix + - '://' + - domainFull + - '/login', + self._redirect_headers(httpPrefix + '://' + + domainFull + '/login', cookie, callingDomain) return - authHeader = createBasicAuthHeader(loginNickname, - loginPassword) + authHeader = \ + createBasicAuthHeader(loginNickname, loginPassword) if not authorizeBasic(baseDir, '/users/' + loginNickname + '/outbox', authHeader, False): @@ -1328,8 +1320,7 @@ class PubServer(BaseHTTPRequestHandler): cookieStr, callingDomain) else: self._redirect_headers(httpPrefix + '://' + - domainFull + - '/users/' + + domainFull + '/users/' + loginNickname + '/' + self.server.defaultTimeline, cookieStr, callingDomain)