mirror of https://gitlab.com/bashrc2/epicyon
Use the followed actor so that we don't need to be concerned about what the users path is
parent
f97d7f4c6a
commit
530f573763
|
@ -2344,7 +2344,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if debug:
|
if debug:
|
||||||
print('You cannot follow the news actor')
|
print('You cannot follow the news actor')
|
||||||
else:
|
else:
|
||||||
if debug:
|
|
||||||
print('Sending follow request from ' +
|
print('Sending follow request from ' +
|
||||||
followerNickname + ' to ' + followingActor)
|
followerNickname + ' to ' + followingActor)
|
||||||
sendFollowRequest(self.server.session,
|
sendFollowRequest(self.server.session,
|
||||||
|
@ -2353,6 +2352,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
httpPrefix,
|
httpPrefix,
|
||||||
followingNickname,
|
followingNickname,
|
||||||
followingDomain,
|
followingDomain,
|
||||||
|
followingActor,
|
||||||
followingPort, httpPrefix,
|
followingPort, httpPrefix,
|
||||||
False, self.server.federationList,
|
False, self.server.federationList,
|
||||||
self.server.sendThreads,
|
self.server.sendThreads,
|
||||||
|
|
|
@ -872,6 +872,7 @@ def followedAccountRejects(session, baseDir: str, httpPrefix: str,
|
||||||
def sendFollowRequest(session, baseDir: str,
|
def sendFollowRequest(session, baseDir: str,
|
||||||
nickname: str, domain: str, port: int, httpPrefix: str,
|
nickname: str, domain: str, port: int, httpPrefix: str,
|
||||||
followNickname: str, followDomain: str,
|
followNickname: str, followDomain: str,
|
||||||
|
followedActor: str,
|
||||||
followPort: int, followHttpPrefix: str,
|
followPort: int, followHttpPrefix: str,
|
||||||
clientToServer: bool, federationList: [],
|
clientToServer: bool, federationList: [],
|
||||||
sendThreads: [], postLog: [], cachedWebfingers: {},
|
sendThreads: [], postLog: [], cachedWebfingers: {},
|
||||||
|
@ -880,6 +881,7 @@ def sendFollowRequest(session, baseDir: str,
|
||||||
"""Gets the json object for sending a follow request
|
"""Gets the json object for sending a follow request
|
||||||
"""
|
"""
|
||||||
if not domainPermitted(followDomain, federationList):
|
if not domainPermitted(followDomain, federationList):
|
||||||
|
print('You are not permitted to follow the domain ' + followDomain)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
fullDomain = getFullDomain(domain, port)
|
fullDomain = getFullDomain(domain, port)
|
||||||
|
@ -890,8 +892,7 @@ def sendFollowRequest(session, baseDir: str,
|
||||||
statusNumber, published = getStatusNumber()
|
statusNumber, published = getStatusNumber()
|
||||||
|
|
||||||
if followNickname:
|
if followNickname:
|
||||||
followedId = followHttpPrefix + '://' + \
|
followedId = followedActor
|
||||||
requestDomain + '/users/' + followNickname
|
|
||||||
followHandle = followNickname + '@' + requestDomain
|
followHandle = followNickname + '@' + requestDomain
|
||||||
else:
|
else:
|
||||||
if debug:
|
if debug:
|
||||||
|
|
4
tests.py
4
tests.py
|
@ -849,10 +849,12 @@ def testFollowBetweenServers():
|
||||||
alicePersonCache = {}
|
alicePersonCache = {}
|
||||||
aliceCachedWebfingers = {}
|
aliceCachedWebfingers = {}
|
||||||
alicePostLog = []
|
alicePostLog = []
|
||||||
|
bobActor = httpPrefix + '://' + bobAddress + '/users/bob'
|
||||||
sendResult = \
|
sendResult = \
|
||||||
sendFollowRequest(sessionAlice, aliceDir,
|
sendFollowRequest(sessionAlice, aliceDir,
|
||||||
'alice', aliceDomain, alicePort, httpPrefix,
|
'alice', aliceDomain, alicePort, httpPrefix,
|
||||||
'bob', bobDomain, bobPort, httpPrefix,
|
'bob', bobDomain, bobActor,
|
||||||
|
bobPort, httpPrefix,
|
||||||
clientToServer, federationList,
|
clientToServer, federationList,
|
||||||
aliceSendThreads, alicePostLog,
|
aliceSendThreads, alicePostLog,
|
||||||
aliceCachedWebfingers, alicePersonCache,
|
aliceCachedWebfingers, alicePersonCache,
|
||||||
|
|
Loading…
Reference in New Issue