forked from indymedia/epicyon
Ensure that followers are updated when accepting follow request
parent
dbd83b6eb9
commit
7e38cac3b7
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue