Don't block self

main
Bob Mottram 2021-08-11 22:21:56 +01:00
parent e52dde8027
commit 78fba638c3
1 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,10 @@ def addBlock(baseDir: str, nickname: str, domain: str,
blockNickname: str, blockDomain: str) -> bool: blockNickname: str, blockDomain: str) -> bool:
"""Block the given account """Block the given account
""" """
if blockDomain.startswith(domain) and nickname == blockNickname:
# don't block self
return False
domain = removeDomainPort(domain) domain = removeDomainPort(domain)
blockingFilename = acctDir(baseDir, nickname, domain) + '/blocking.txt' blockingFilename = acctDir(baseDir, nickname, domain) + '/blocking.txt'
blockHandle = blockNickname + '@' + blockDomain blockHandle = blockNickname + '@' + blockDomain