main
Bob Mottram 2020-02-19 12:51:14 +00:00
parent 4019814a05
commit 7e8d59e85c
2 changed files with 12 additions and 9 deletions

View File

@ -52,7 +52,7 @@ def removeFromFollowBase(baseDir: str, \
approveFollowsFilename=accountsDir+'/'+followFile+'.txt' approveFollowsFilename=accountsDir+'/'+followFile+'.txt'
if not os.path.isfile(approveFollowsFilename): if not os.path.isfile(approveFollowsFilename):
if debug: if debug:
print('WARN: Follow requests file '+approveFollowsFilename+' not found') print('WARN: Approve follow requests file '+approveFollowsFilename+' not found')
return return
if acceptOrDenyHandle not in open(approveFollowsFilename).read(): if acceptOrDenyHandle not in open(approveFollowsFilename).read():
return return
@ -380,7 +380,7 @@ def followApprovalRequired(baseDir: str,nicknameToFollow: str, \
manuallyApproveFollows=actor['manuallyApprovesFollowers'] manuallyApproveFollows=actor['manuallyApprovesFollowers']
else: else:
if debug: if debug:
print('manuallyApprovesFollowers is missing from '+actorFilename) print(nicknameToFollow+'@'+domainToFollow+' automatically approves followers')
else: else:
if debug: if debug:
print('DEBUG: Actor file not found: '+actorFilename) print('DEBUG: Actor file not found: '+actorFilename)
@ -545,6 +545,7 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
approveHandle=nickname+'@'+domainFull approveHandle=nickname+'@'+domainFull
if followApprovalRequired(baseDir,nicknameToFollow, \ if followApprovalRequired(baseDir,nicknameToFollow, \
domainToFollow,debug,approveHandle): domainToFollow,debug,approveHandle):
print('Follow approval is required')
if not domain.endswith('.onion'): if not domain.endswith('.onion'):
if noOfFollowRequests(baseDir, \ if noOfFollowRequests(baseDir, \
nicknameToFollow,domainToFollow, \ nicknameToFollow,domainToFollow, \
@ -751,13 +752,14 @@ def sendFollowRequest(session,baseDir: str, \
'object': followedId 'object': followedId
} }
# Remove any follow requests rejected for the account being followed. if followApprovalRequired(baseDir,nickname,domain,debug,followHandle):
# It's assumed that if you are following someone then you are # Remove any follow requests rejected for the account being followed.
# ok with them following back. If this isn't the case then a rejected # It's assumed that if you are following someone then you are
# follow request will block them again. # ok with them following back. If this isn't the case then a rejected
removeFromFollowRejects(baseDir, \ # follow request will block them again.
nickname,domain, \ removeFromFollowRejects(baseDir, \
followHandle,debug) nickname,domain, \
followHandle,debug)
sendSignedJson(newFollowJson,session,baseDir,nickname,domain,port, \ sendSignedJson(newFollowJson,session,baseDir,nickname,domain,port, \
followNickname,followDomain,followPort, \ followNickname,followDomain,followPort, \

View File

@ -610,6 +610,7 @@ def testFollowBetweenServersWithCapabilities():
eveDomain='127.0.0.55' eveDomain='127.0.0.55'
evePort=61937 evePort=61937
eveSendThreads=[] eveSendThreads=[]
global thrEve global thrEve
if thrEve: if thrEve:
while thrEve.isAlive(): while thrEve.isAlive():