Remove unused flag

master
Bob Mottram 2019-08-05 10:50:45 +01:00
parent 13f53414b4
commit 438b778dd3
2 changed files with 28 additions and 33 deletions

View File

@ -355,7 +355,7 @@ class PubServer(BaseHTTPRequestHandler):
messageJson,self.server.debug)
return True
def _updateInboxQueue(self,nickname: str,messageJson: {},postFromWebInterface: bool) -> int:
def _updateInboxQueue(self,nickname: str,messageJson: {}) -> int:
"""Update the inbox queue
"""
# Check if the queue is full
@ -376,7 +376,6 @@ class PubServer(BaseHTTPRequestHandler):
self.headers['host'],
self.headers['signature'],
'/'+self.path.split('/')[-1],
postFromWebInterface,
self.server.debug)
if queueFilename:
# add json to the queue
@ -2200,7 +2199,7 @@ class PubServer(BaseHTTPRequestHandler):
else:
self.postToNickname=pathUsersSection.split('/')[0]
if self.postToNickname:
queueStatus=self._updateInboxQueue(self.postToNickname,messageJson,False)
queueStatus=self._updateInboxQueue(self.postToNickname,messageJson)
if queueStatus==0:
self.send_response(200)
self.end_headers()
@ -2218,7 +2217,7 @@ class PubServer(BaseHTTPRequestHandler):
else:
if self.path == '/sharedInbox' or self.path == '/inbox':
print('DEBUG: POST to shared inbox')
queueStatus=_updateInboxQueue('inbox',messageJson,False)
queueStatus=_updateInboxQueue('inbox',messageJson)
if queueStatus==0:
self.send_response(200)
self.end_headers()

View File

@ -158,7 +158,7 @@ def validPublishedDate(published) -> bool:
return False
return True
def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str,postJsonObject: {},host: str,headers: str,postPath: str,postFromWebInterface: bool,debug: bool) -> str:
def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str,postJsonObject: {},host: str,headers: str,postPath: str,debug: bool) -> str:
"""Saves the give json to the inbox queue for the person
keyId specifies the actor sending the post
"""
@ -222,8 +222,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str
'path': postPath,
'post': postJsonObject,
'filename': filename,
'destination': destination,
'postFromWebInterface': postFromWebInterface
'destination': destination
}
if debug:
@ -1054,8 +1053,6 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
pubKey=None
keyId=None
for tries in range(8):
if queueJson['postFromWebInterface']:
break
keyId=None
signatureParams=queueJson['headers'].split(',')
for signatureItem in signatureParams:
@ -1079,7 +1076,6 @@ def runInboxQueue(baseDir: str,httpPrefix: str,sendThreads: [],postLog: [], \
print('DEBUG: Retry '+str(tries+1)+' obtaining public key for '+keyId)
time.sleep(5)
if not queueJson['postFromWebInterface']:
if not pubKey:
if debug:
print('DEBUG: public key could not be obtained from '+keyId)