From 99929a9a289ee0140e98cc3f777c86e5beb3639e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 24 Aug 2019 22:14:33 +0100 Subject: [PATCH] options processed earlier --- daemon.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/daemon.py b/daemon.py index 72e7bce2..d86351ad 100644 --- a/daemon.py +++ b/daemon.py @@ -531,6 +531,23 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy=False return + # show the person options screen with view/follow/block/report + if htmlGET and '/users/' in self.path: + if '?options=' in self.path: + optionsStr=self.path.split('?options=')[1] + originPathStr=self.path.split('?options=')[0] + if ';' in optionsStr: + optionsActor=optionsStr.split(';')[0] + optionsProfileUrl=optionsStr.split(';')[1] + msg=htmlPersonOptions(self.server.baseDir,originPathStr,optionsActor,optionsProfileUrl).encode() + self._set_headers('text/html',len(msg),cookie) + self.wfile.write(msg) + self.server.GETbusy=False + return + self._redirect_headers(originPathStr,cookie) + self.server.GETbusy=False + return + # if not authorized then show the login screen if htmlGET and self.path!='/login' and self.path!='/' and self.path!='/terms': if '/media/' not in self.path and \ @@ -809,23 +826,6 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy=False return - # show the person options screen with view/follow/block/report - if '/users/' in self.path: - if '?options=' in self.path: - optionsStr=self.path.split('?options=')[1] - originPathStr=self.path.split('?options=')[0] - if ';' in optionsStr: - optionsActor=optionsStr.split(';')[0] - optionsProfileUrl=optionsStr.split(';')[1] - msg=htmlPersonOptions(self.server.baseDir,originPathStr,optionsActor,optionsProfileUrl).encode() - self._set_headers('text/html',len(msg),cookie) - self.wfile.write(msg) - self.server.GETbusy=False - return - self._redirect_headers(originPathStr,cookie) - self.server.GETbusy=False - return - # hashtag search if self.path.startswith('/tags/'): pageNumber=1