merge-requests/6/head
Bob Mottram 2019-11-29 13:07:20 +00:00
parent 4327a72542
commit 9c8702133b
1 changed files with 19 additions and 76 deletions

View File

@ -4979,79 +4979,22 @@ class PubServer(BaseHTTPRequestHandler):
self._benchmarkPOSTtimings(POSTstartTime,POSTtimings,14) self._benchmarkPOSTtimings(POSTstartTime,POSTtimings,14)
pageNumber=self._receiveNewPost(authorized,'newpost',self.path) # receive different types of post created by htmlNewPost
postTypes=["newpost","newunlisted","newfollowers","newdm","newreport","newshare"]
for currPostType in postTypes:
if currPostType!='newshare':
postRedirect=self.server.defaultTimeline
else:
postRedirect='shares'
pageNumber=self._receiveNewPost(authorized,currPostType,self.path)
if pageNumber: if pageNumber:
nickname=self.path.split('/users/')[1] nickname=self.path.split('/users/')[1]
if '/' in nickname: if '/' in nickname:
nickname=nickname.split('/')[0] nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \ self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \ '/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \ '/'+postRedirect+ \
'?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newunlisted',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \
'?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newfollowers',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \
'?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newdm',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \
'?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newreport',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \
'?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newshare',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/shares?page='+str(pageNumber),cookie)
self.server.POSTbusy=False
return
pageNumber=self._receiveNewPost(authorized,'newquestion',self.path)
if pageNumber:
nickname=self.path.split('/users/')[1]
if '/' in nickname:
nickname=nickname.split('/')[0]
self._redirect_headers(self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+nickname+ \
'/'+self.server.defaultTimeline+ \
'?page='+str(pageNumber),cookie) '?page='+str(pageNumber),cookie)
self.server.POSTbusy=False self.server.POSTbusy=False
return return