From 7e38cac3b78ad39cb80f356d5227ff5536b628bd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Aug 2019 23:22:01 +0100 Subject: [PATCH] Ensure that followers are updated when accepting follow request --- manualapprove.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/manualapprove.py b/manualapprove.py index 623917971..023208736 100644 --- a/manualapprove.py +++ b/manualapprove.py @@ -56,6 +56,7 @@ def manualApproveFollowRequest(session,baseDir: str, \ if debug: print(handle+' not in '+approveFollowsFilename) return + approvefilenew = open(approveFollowsFilename+'.new', 'w+') with open(approveFollowsFilename, 'r') as approvefile: for handle in approvefile: @@ -88,3 +89,14 @@ def manualApproveFollowRequest(session,baseDir: str, \ approvefilenew.write(handle) approvefilenew.close() os.rename(approveFollowsFilename+'.new',approveFollowsFilename) + # update the followers + followersFilename=accountsDir+'/followers.txt' + if os.path.isfile(followersFilename): + if approveHandle not in open(followersFilename).read(): + followersFile=open(followersFilename, "a+") + followersFile.write(approveHandle+'\n') + followersFile.close() + else: + followersFile=open(followersFilename, "w+") + followersFile.write(approveHandle+'\n') + followersFile.close()