Don't store follow request if it has already been denied

main2
Bob Mottram 2019-09-18 20:01:07 +01:00
parent 7f9b9c5c92
commit 2dcf6a9af1
1 changed files with 6 additions and 0 deletions

View File

@ -357,6 +357,12 @@ def storeFollowRequest(baseDir: str, \
' already following '+approveHandle) ' already following '+approveHandle)
return True return True
# should this follow be denied?
denyFollowsFilename=accountsDir+'/followrejects.txt'
if os.path.isfile(denyFollowsFilename):
if approveHandle not in open(denyFollowsFilename).read():
return True
# add to a file which contains a list of requests # add to a file which contains a list of requests
approveFollowsFilename=accountsDir+'/followrequests.txt' approveFollowsFilename=accountsDir+'/followrequests.txt'
if os.path.isfile(approveFollowsFilename): if os.path.isfile(approveFollowsFilename):