main2
Bob Mottram 2019-10-06 10:57:49 +01:00
parent 49a044a2a7
commit 36ffe273be
1 changed files with 5 additions and 3 deletions

View File

@ -536,18 +536,20 @@ def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
"""The person receiving a follow request accepts the new follower """The person receiving a follow request accepts the new follower
and sends back an Accept activity and sends back an Accept activity
""" """
acceptHandle=nickname+'@'+domain
# Remove any follow requests rejected for the account being followed. # Remove any follow requests rejected for the account being followed.
# It's assumed that if you are following someone then you are # It's assumed that if you are following someone then you are
# ok with them following back. If this isn't the case then a rejected # ok with them following back. If this isn't the case then a rejected
# follow request will block them again. # follow request will block them again.
removeFromFollowRejects(baseDir, \ removeFromFollowRejects(baseDir, \
nicknameToFollow,domainToFollow, \ nicknameToFollow,domainToFollow, \
nickname+'@'+domain) acceptHandle)
# send accept back # send accept back
if debug: if debug:
print('DEBUG: sending Accept activity for follow request which arrived at '+ \ print('DEBUG: sending Accept activity for follow request which arrived at '+ \
nicknameToFollow+'@'+domainToFollow+' back to '+nickname+'@'+domain) nicknameToFollow+'@'+domainToFollow+' back to '+acceptHandle)
acceptJson=createAccept(baseDir,federationList, \ acceptJson=createAccept(baseDir,federationList, \
nicknameToFollow,domainToFollow,port, \ nicknameToFollow,domainToFollow,port, \
personUrl,'',httpPrefix,followJson,acceptedCaps) personUrl,'',httpPrefix,followJson,acceptedCaps)
@ -556,7 +558,7 @@ def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
print('DEBUG: sending follow Accept from '+ \ print('DEBUG: sending follow Accept from '+ \
nicknameToFollow+'@'+domainToFollow+ \ nicknameToFollow+'@'+domainToFollow+ \
' port '+str(port)+' to '+ \ ' port '+str(port)+' to '+ \
nickname+'@'+domain+' port '+ str(fromPort)) acceptHandle+' port '+ str(fromPort))
clientToServer=False clientToServer=False
return sendSignedJson(acceptJson,session,baseDir, \ return sendSignedJson(acceptJson,session,baseDir, \
nicknameToFollow,domainToFollow,port, \ nicknameToFollow,domainToFollow,port, \