Get username for poster

main
Bob Mottram 2020-02-21 12:29:51 +00:00
parent fd459e383f
commit dcd413c99a
1 changed files with 8 additions and 5 deletions

View File

@ -3775,7 +3775,12 @@ class PubServer(BaseHTTPRequestHandler):
pageNumber=int(pageNumberStr)
path=path.split('?page=')[0]
newPostThreadName=self.postToNickname
# get the username who posted
newPostThreadName=None
if '/users/' in path:
newPostThreadName=path.split('/users/')[1]
if '/' in nickname:
newPostThreadName=newPostThreadName.split('/')[0]
if not newPostThreadName:
newPostThreadName='*'
@ -3786,6 +3791,7 @@ class PubServer(BaseHTTPRequestHandler):
time.sleep(1)
waitCtr+=1
if waitCtr>=8:
print('Killing previous new post thread for '+newPostThreadName)
self.server.newPostThread[newPostThreadName].kill()
# make a copy of self.headers
@ -5147,9 +5153,6 @@ class PubServer(BaseHTTPRequestHandler):
pageNumber=self._receiveNewPost(authorized,currPostType,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+ \
'/'+postRedirect+ \