Variable name

merge-requests/30/head
Bob Mottram 2021-08-12 15:16:13 +01:00
parent a9d10593f2
commit a6149853ca
3 changed files with 6 additions and 17 deletions

View File

@ -50,7 +50,7 @@ def muteConversation(baseDir: str, nickname: str, domain: str,
conversationId: str) -> None:
"""Mutes the given conversation
"""
conversationDir = acctDir(baseDir, nickname, domain) + '/conversation'
conversationDir = acctDir(baseDir, nickname, domain) + '/conversation'
conversationFilename = \
conversationDir + '/' + conversationId.replace('/', '#')
if not os.path.isfile(conversationFilename):

View File

@ -683,17 +683,12 @@ class PubServer(BaseHTTPRequestHandler):
def _set_headers_base(self, fileFormat: str, length: int, cookie: str,
callingDomain: str, permissive: bool) -> None:
self.send_response(200)
if permissive:
# use lower case
self.send_header('content-type', fileFormat)
if length > -1:
self.send_header('content-length', str(length))
self.send_header('host', callingDomain)
return
self.send_header('Content-type', fileFormat)
if length > -1:
self.send_header('Content-Length', str(length))
self.send_header('Host', callingDomain)
if permissive:
return
if cookie:
cookieStr = cookie
if 'HttpOnly;' not in cookieStr:
@ -718,10 +713,7 @@ class PubServer(BaseHTTPRequestHandler):
self._set_headers_base(fileFormat, length, None, callingDomain,
permissive)
if etag:
if permissive:
self.send_header('etag', '"' + etag + '"')
else:
self.send_header('ETag', '"' + etag + '"')
self.send_header('ETag', '"' + etag + '"')
self.end_headers()
def _set_headers_etag(self, mediaFilename: str, fileFormat: str,
@ -746,10 +738,7 @@ class PubServer(BaseHTTPRequestHandler):
except BaseException:
pass
if etag:
if permissive:
self.send_header('etag', '"' + etag + '"')
else:
self.send_header('ETag', '"' + etag + '"')
self.send_header('ETag', '"' + etag + '"')
if lastModified:
self.send_header('last-modified', lastModified)
self.end_headers()

View File

@ -1501,7 +1501,7 @@ def _deleteConversationPost(baseDir: str, nickname: str, domain: str,
conversationId = postJsonObject['object']['conversation']
conversationId = conversationId.replace('/', '#')
postId = postJsonObject['object']['id']
conversationFilename = conversationDir + '/' + conversation
conversationFilename = conversationDir + '/' + conversationId
if not os.path.isfile(conversationFilename):
return False
conversationStr = ''