master
Bob Mottram 2019-08-07 14:05:09 +01:00
parent e8e347199c
commit f189994879
1 changed files with 47 additions and 39 deletions

View File

@ -18,7 +18,8 @@ def manualDenyFollowRequest(baseDir: str,nickname: str,domain: str,denyHandle: s
handle=args.nickname+'@'+domain
accountsDir=baseDir+'/accounts/'+handle
approveFollowsFilename=accountsDir+'/followrequests.txt'
if handle in open(approveFollowsFilename).read():
if handle not in open(approveFollowsFilename).read():
return
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
with open(approveFollowsFilename, 'r') as approvefile:
for approveHandle in approvefile:
@ -35,13 +36,20 @@ def manualApproveFollowRequest(session,baseDir: str, \
sendThreads: [],postLog: [], \
cachedWebfingers: {},personCache: {}, \
acceptedCaps: [], \
debug: bool):
debug: bool) -> None:
"""Manually approve a follow request
"""
handle=nickname+'@'+domain
accountsDir=baseDir+'/accounts/'+handle
approveFollowsFilename=accountsDir+'/followrequests.txt'
if handle in open(approveFollowsFilename).read():
if not os.path.isfile(approveFollowsFilename):
if debug:
print('WARN: Follow requests file '+approveFollowsFilename+' not found')
return
if handle not in open(approveFollowsFilename).read():
if debug:
print(handle+' not in '+approveFollowsFilename)
return
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
with open(approveFollowsFilename, 'r') as approvefile:
for handle in approvefile: