From 32127cae185ee7e4180659b70bfcadfc7900ee7d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Aug 2019 23:38:09 +0100 Subject: [PATCH] Check if already a follower --- follow.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/follow.py b/follow.py index 1ad8c1f8b..68572292a 100644 --- a/follow.py +++ b/follow.py @@ -309,6 +309,15 @@ def storeFollowRequest(baseDir: str, \ if ':' not in domain: approveHandle=nickname+'@'+domain+':'+str(fromPort) + followersFilename=accountsDir+'/followers.txt' + if os.path.isfile(followersFilename): + if approveHandle in open(followersFilename).read(): + if debug: + print('DEBUG: '+ \ + nicknameToFollow+'@'+domainToFollow+ \ + ' already following '+approveHandle) + return True + # add to a file which contains a list of requests approveFollowsFilename=accountsDir+'/followrequests.txt' if os.path.isfile(approveFollowsFilename):