Return true to prevent further follow attempts

master
Bob Mottram 2019-08-26 19:41:35 +01:00
parent e3eb74e65b
commit 91a66a6972
1 changed files with 4 additions and 4 deletions

View File

@ -380,7 +380,7 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
if not domainPermitted(domainToFollow,federationList): if not domainPermitted(domainToFollow,federationList):
if debug: if debug:
print('DEBUG: follow domain not permitted '+domainToFollow) print('DEBUG: follow domain not permitted '+domainToFollow)
return False return True
domainToFollowFull=domainToFollow domainToFollowFull=domainToFollow
if tempPort: if tempPort:
if tempPort!=80 and tempPort!=443: if tempPort!=80 and tempPort!=443:
@ -390,14 +390,14 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
if not nicknameToFollow: if not nicknameToFollow:
if debug: if debug:
print('DEBUG: follow request does not contain a nickname for the account followed') print('DEBUG: follow request does not contain a nickname for the account followed')
return False return True
handleToFollow=nicknameToFollow+'@'+domainToFollow handleToFollow=nicknameToFollow+'@'+domainToFollow
if domainToFollow==domain: if domainToFollow==domain:
if not os.path.isdir(baseDir+'/accounts/'+handleToFollow): if not os.path.isdir(baseDir+'/accounts/'+handleToFollow):
if debug: if debug:
print('DEBUG: followed account not found - '+ \ print('DEBUG: followed account not found - '+ \
baseDir+'/accounts/'+handleToFollow) baseDir+'/accounts/'+handleToFollow)
return False return True
if not followerOfPerson(baseDir,nicknameToFollow,domainToFollowFull, \ if not followerOfPerson(baseDir,nicknameToFollow,domainToFollowFull, \
nickname,domainFull,federationList,debug): nickname,domainFull,federationList,debug):
@ -405,7 +405,7 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
print('DEBUG: '+nickname+'@'+domain+ \ print('DEBUG: '+nickname+'@'+domain+ \
' is already a follower of '+ \ ' is already a follower of '+ \
nicknameToFollow+'@'+domainToFollow) nicknameToFollow+'@'+domainToFollow)
return False return True
# what is the followers policy? # what is the followers policy?
if followApprovalRequired(baseDir,nicknameToFollow, \ if followApprovalRequired(baseDir,nicknameToFollow, \