Check that strings are valid

main
Bob Mottram 2020-02-05 17:39:41 +00:00
parent ba091b74e4
commit 419b5746c7
1 changed files with 8 additions and 6 deletions

View File

@ -134,9 +134,10 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
if os.path.isfile(globalBlockingFilename):
if '*@'+blockDomain in open(globalBlockingFilename).read():
return True
blockHandle=blockNickname+'@'+blockDomain
if blockHandle in open(globalBlockingFilename).read():
return True
if blockNickname and blockDomain:
blockHandle=blockNickname+'@'+blockDomain
if blockHandle in open(globalBlockingFilename).read():
return True
allowFilename= \
baseDir+'/accounts/'+nickname+'@'+domain+'/allowedinstances.txt'
if os.path.isfile(allowFilename):
@ -147,9 +148,10 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
if os.path.isfile(blockingFilename):
if '*@'+blockDomain in open(blockingFilename).read():
return True
blockHandle=blockNickname+'@'+blockDomain
if blockHandle in open(blockingFilename).read():
return True
if blockNickname and blockDomain:
blockHandle=blockNickname+'@'+blockDomain
if blockHandle in open(blockingFilename).read():
return True
return False
def sendBlockViaServer(baseDir: str,session, \