mirror of https://gitlab.com/bashrc2/epicyon
Sequence
parent
cd4e0cb7a1
commit
39e5a3abee
34
daemon.py
34
daemon.py
|
@ -495,6 +495,23 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if 'text/html' in self.headers['Accept']:
|
||||
htmlGET=True
|
||||
|
||||
# Unfollow a person from the web interface by selecting Unfollow on the dropdown
|
||||
if htmlGET and '/users/' in self.path and '?unfollow=' in self.path:
|
||||
followStr=self.path.split('?unfollow=')[1]
|
||||
originPathStr=self.path.split('?unfollow=')[0]
|
||||
if ';' in followStr:
|
||||
followActor=followStr.split(';')[0]
|
||||
followProfileUrl=followStr.split(';')[1]
|
||||
# show the confirm follow screen
|
||||
msg=htmlUnfollowConfirm(self.server.baseDir,originPathStr,followActor,followProfileUrl).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 \
|
||||
|
@ -826,23 +843,6 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.GETbusy=False
|
||||
return
|
||||
|
||||
# Unfollow a person from the web interface by selecting Unfollow on the dropdown
|
||||
if '/users/' in self.path and '?unfollow=' in self.path:
|
||||
followStr=self.path.split('?unfollow=')[1]
|
||||
originPathStr=self.path.split('?unfollow=')[0].replace('/following','')
|
||||
if ';' in followStr:
|
||||
followActor=followStr.split(';')[0]
|
||||
followProfileUrl=followStr.split(';')[1]
|
||||
# show the confirm follow screen
|
||||
msg=htmlUnfollowConfirm(self.server.baseDir,originPathStr,followActor,followProfileUrl).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
|
||||
|
||||
# Unblock a person from the web interface by selecting Unblock on the dropdown
|
||||
if htmlGET and '/users/' in self.path:
|
||||
if '?unblock=' in self.path:
|
||||
|
|
Loading…
Reference in New Issue