forked from indymedia/epicyon
Follow file not strictly required for approval
parent
2276b5661b
commit
d1493585bc
|
@ -525,7 +525,7 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
|
|||
messageJson,acceptedCaps, \
|
||||
sendThreads,postLog, \
|
||||
cachedWebfingers,personCache, \
|
||||
debug,projectVersion)
|
||||
debug,projectVersion,True)
|
||||
|
||||
def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
|
||||
nicknameToFollow: str,domainToFollow: str,port: int, \
|
||||
|
@ -534,7 +534,8 @@ def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
|
|||
followJson: {},acceptedCaps: [], \
|
||||
sendThreads: [],postLog: [], \
|
||||
cachedWebfingers: {},personCache: {}, \
|
||||
debug: bool,projectVersion: str):
|
||||
debug: bool,projectVersion: str, \
|
||||
removeFollowActivity: bool):
|
||||
"""The person receiving a follow request accepts the new follower
|
||||
and sends back an Accept activity
|
||||
"""
|
||||
|
@ -555,6 +556,7 @@ def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
|
|||
acceptHandle+' port '+ str(fromPort))
|
||||
clientToServer=False
|
||||
|
||||
if removeFollowActivity:
|
||||
# remove the follow request json
|
||||
followActivityfilename= \
|
||||
baseDir+'/accounts/'+ \
|
||||
|
|
|
@ -86,6 +86,7 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
|||
|
||||
approvefilenew = open(approveFollowsFilename+'.new', 'w+')
|
||||
updateApprovedFollowers=False
|
||||
followActivityfilename=None
|
||||
with open(approveFollowsFilename, 'r') as approvefile:
|
||||
for handleOfFollowRequester in approvefile:
|
||||
# is this the approved follow?
|
||||
|
@ -113,7 +114,7 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
|||
followJson,acceptedCaps, \
|
||||
sendThreads,postLog, \
|
||||
cachedWebfingers,personCache, \
|
||||
debug,projectVersion)
|
||||
debug,projectVersion,False)
|
||||
updateApprovedFollowers=True
|
||||
else:
|
||||
# this isn't the approved follow so it will remain
|
||||
|
@ -147,5 +148,9 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
|||
if approveHandle in open(followersFilename).read():
|
||||
# update the follow requests with the handles not yet approved
|
||||
os.rename(approveFollowsFilename+'.new',approveFollowsFilename)
|
||||
# remove the .follow file
|
||||
if followActivityfilename:
|
||||
if os.path.isfile(followActivityfilename):
|
||||
os.remove(followActivityfilename)
|
||||
else:
|
||||
os.remove(approveFollowsFilename+'.new')
|
||||
|
|
Loading…
Reference in New Issue