master
Bob Mottram 2019-08-21 18:11:39 +01:00
parent cd4e0cb7a1
commit 39e5a3abee
1 changed files with 18 additions and 18 deletions

View File

@ -495,6 +495,23 @@ class PubServer(BaseHTTPRequestHandler):
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: