forked from indymedia/epicyon
Remove follow request json after reject
parent
decafa082d
commit
b6c2a13390
10
follow.py
10
follow.py
|
@ -577,6 +577,7 @@ def followedAccountRejects(session,baseDir: str,httpPrefix: str, \
|
||||||
print('DEBUG: sending Reject activity for follow request which arrived at '+ \
|
print('DEBUG: sending Reject activity for follow request which arrived at '+ \
|
||||||
nicknameToFollow+'@'+domainToFollow+' back to '+nickname+'@'+domain)
|
nicknameToFollow+'@'+domainToFollow+' back to '+nickname+'@'+domain)
|
||||||
|
|
||||||
|
# get the json for the original follow request
|
||||||
followRequestJsonFilename= \
|
followRequestJsonFilename= \
|
||||||
baseDir+'/accounts/'+ \
|
baseDir+'/accounts/'+ \
|
||||||
nicknameToFollow+'@'+domainToFollow+'/requests/'+ \
|
nicknameToFollow+'@'+domainToFollow+'/requests/'+ \
|
||||||
|
@ -586,8 +587,10 @@ def followedAccountRejects(session,baseDir: str,httpPrefix: str, \
|
||||||
print('No follow request json was found for '+ \
|
print('No follow request json was found for '+ \
|
||||||
followRequestJsonFilename)
|
followRequestJsonFilename)
|
||||||
return None
|
return None
|
||||||
|
# actor who made the follow request
|
||||||
personUrl=followJson['actor']
|
personUrl=followJson['actor']
|
||||||
|
|
||||||
|
# create the reject activity
|
||||||
rejectJson= \
|
rejectJson= \
|
||||||
createReject(baseDir,federationList, \
|
createReject(baseDir,federationList, \
|
||||||
nicknameToFollow,domainToFollow,port, \
|
nicknameToFollow,domainToFollow,port, \
|
||||||
|
@ -603,7 +606,14 @@ def followedAccountRejects(session,baseDir: str,httpPrefix: str, \
|
||||||
if fromPort:
|
if fromPort:
|
||||||
if fromPort!=80 and fromPort!=443:
|
if fromPort!=80 and fromPort!=443:
|
||||||
denyHandle=denyHandle+':'+str(fromPort)
|
denyHandle=denyHandle+':'+str(fromPort)
|
||||||
|
# remove from the follow requests file
|
||||||
removeFromFollowRequests(baseDir,nicknameToFollow,domainToFollow,denyHandle,debug)
|
removeFromFollowRequests(baseDir,nicknameToFollow,domainToFollow,denyHandle,debug)
|
||||||
|
# remove the follow request json
|
||||||
|
try:
|
||||||
|
os.remove(followRequestJsonFilename)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
# send the reject activity
|
||||||
return sendSignedJson(rejectJson,session,baseDir, \
|
return sendSignedJson(rejectJson,session,baseDir, \
|
||||||
nicknameToFollow,domainToFollow,port, \
|
nicknameToFollow,domainToFollow,port, \
|
||||||
nickname,domain,fromPort, '', \
|
nickname,domain,fromPort, '', \
|
||||||
|
|
Loading…
Reference in New Issue