Instance level blocks

master
Bob Mottram 2019-08-02 12:46:42 +01:00
parent 3a9bdea0f7
commit bf3ef893aa
2 changed files with 3 additions and 1 deletions

View File

@ -52,6 +52,8 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
blockingFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/blocking.txt' blockingFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/blocking.txt'
blockHandle=blockNickname+'@'+blockDomain blockHandle=blockNickname+'@'+blockDomain
if os.path.isfile(blockingFilename): if os.path.isfile(blockingFilename):
if '*@'+blockDomain in open(blockingFilename).read():
return True
if blockHandle in open(blockingFilename).read(): if blockHandle in open(blockingFilename).read():
return True return True
return False return False

View File

@ -96,7 +96,7 @@ def htmlEditProfile(baseDir: str,path: str,domain: str,port: int) -> str:
' <br>Filtered words' \ ' <br>Filtered words' \
' <textarea id="message" name="filteredWords" placeholder="Filtered words or phrases (one per line)" style="height:200px">'+filterStr+'</textarea>' \ ' <textarea id="message" name="filteredWords" placeholder="Filtered words or phrases (one per line)" style="height:200px">'+filterStr+'</textarea>' \
' <br>Blocked accounts' \ ' <br>Blocked accounts' \
' <textarea id="message" name="blocked" placeholder="Blocked accounts, one per line, in the form nickname@domain" style="height:200px">'+blockedStr+'</textarea>' \ ' <textarea id="message" name="blocked" placeholder="Blocked accounts, one per line, in the form nickname@domain or *@blockeddomain" style="height:200px">'+blockedStr+'</textarea>' \
' </div>' \ ' </div>' \
' <div class="container">' \ ' <div class="container">' \
' <input type="submit" name="submitProfile" value="Submit">' \ ' <input type="submit" name="submitProfile" value="Submit">' \