mirror of https://gitlab.com/bashrc2/epicyon
Sequence
parent
cd4e0cb7a1
commit
39e5a3abee
36
daemon.py
36
daemon.py
|
@ -494,7 +494,24 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if self.headers.get('Accept'):
|
if self.headers.get('Accept'):
|
||||||
if 'text/html' in self.headers['Accept']:
|
if 'text/html' in self.headers['Accept']:
|
||||||
htmlGET=True
|
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 not authorized then show the login screen
|
||||||
if htmlGET and self.path!='/login' and self.path!='/' and self.path!='/terms':
|
if htmlGET and self.path!='/login' and self.path!='/' and self.path!='/terms':
|
||||||
if '/media/' not in self.path and \
|
if '/media/' not in self.path and \
|
||||||
|
@ -826,23 +843,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
return
|
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
|
# Unblock a person from the web interface by selecting Unblock on the dropdown
|
||||||
if htmlGET and '/users/' in self.path:
|
if htmlGET and '/users/' in self.path:
|
||||||
if '?unblock=' in self.path:
|
if '?unblock=' in self.path:
|
||||||
|
|
Loading…
Reference in New Issue