mirror of https://gitlab.com/bashrc2/epicyon
Fix sending of follow rejects
parent
daa2000b8d
commit
decafa082d
22
follow.py
22
follow.py
|
@ -565,8 +565,7 @@ def followedAccountAccepts(session,baseDir: str,httpPrefix: str, \
|
|||
def followedAccountRejects(session,baseDir: str,httpPrefix: str, \
|
||||
nicknameToFollow: str,domainToFollow: str,port: int, \
|
||||
nickname: str,domain: str,fromPort: int, \
|
||||
personUrl: str,federationList: [], \
|
||||
followJson: {}, \
|
||||
federationList: [], \
|
||||
sendThreads: [],postLog: [], \
|
||||
cachedWebfingers: {},personCache: {}, \
|
||||
debug: bool,projectVersion: str):
|
||||
|
@ -577,9 +576,22 @@ def followedAccountRejects(session,baseDir: str,httpPrefix: str, \
|
|||
if debug:
|
||||
print('DEBUG: sending Reject activity for follow request which arrived at '+ \
|
||||
nicknameToFollow+'@'+domainToFollow+' back to '+nickname+'@'+domain)
|
||||
rejectJson=createReject(baseDir,federationList, \
|
||||
nicknameToFollow,domainToFollow,port, \
|
||||
personUrl,'',httpPrefix,followJson)
|
||||
|
||||
followRequestJsonFilename= \
|
||||
baseDir+'/accounts/'+ \
|
||||
nicknameToFollow+'@'+domainToFollow+'/requests/'+ \
|
||||
nickname+'@'+domain+'.follow'
|
||||
followJson=loadJson(followRequestJsonFilename)
|
||||
if not followJson:
|
||||
print('No follow request json was found for '+ \
|
||||
followRequestJsonFilename)
|
||||
return None
|
||||
personUrl=followJson['actor']
|
||||
|
||||
rejectJson= \
|
||||
createReject(baseDir,federationList, \
|
||||
nicknameToFollow,domainToFollow,port, \
|
||||
personUrl,'',httpPrefix,followJson)
|
||||
if debug:
|
||||
pprint(rejectJson)
|
||||
print('DEBUG: sending follow Reject from '+ \
|
||||
|
|
|
@ -50,16 +50,13 @@ def manualDenyFollowRequest(session,baseDir: str, \
|
|||
if ':' in denyDomain:
|
||||
denyPort=denyDomain.split(':')[1]
|
||||
denyDomain=denyDomain.split(':')[0]
|
||||
# TODO
|
||||
#followJson=
|
||||
#followedAccountRejects(session,baseDir,httpPrefix, \
|
||||
# nickname,domain,port, \
|
||||
# denyNickname,denyDomain,denyPort, \
|
||||
# followJson['actor'],federationList, \
|
||||
# followJson, \
|
||||
# sendThreads,postLog, \
|
||||
# cachedWebfingers,personCache, \
|
||||
# debug,projectVersion)
|
||||
followedAccountRejects(session,baseDir,httpPrefix, \
|
||||
nickname,domain,port, \
|
||||
denyNickname,denyDomain,denyPort, \
|
||||
federationList, \
|
||||
sendThreads,postLog, \
|
||||
cachedWebfingers,personCache, \
|
||||
debug,projectVersion)
|
||||
|
||||
print('Follow request from '+denyHandle+' was denied.')
|
||||
|
||||
|
|
Loading…
Reference in New Issue