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,15 +2344,15 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if debug:
|
||||
print('You cannot follow the news actor')
|
||||
else:
|
||||
if debug:
|
||||
print('Sending follow request from ' +
|
||||
followerNickname + ' to ' + followingActor)
|
||||
print('Sending follow request from ' +
|
||||
followerNickname + ' to ' + followingActor)
|
||||
sendFollowRequest(self.server.session,
|
||||
baseDir, followerNickname,
|
||||
domain, port,
|
||||
httpPrefix,
|
||||
followingNickname,
|
||||
followingDomain,
|
||||
followingActor,
|
||||
followingPort, httpPrefix,
|
||||
False, self.server.federationList,
|
||||
self.server.sendThreads,
|
||||
|
|
|
@ -872,6 +872,7 @@ def followedAccountRejects(session, baseDir: str, httpPrefix: str,
|
|||
def sendFollowRequest(session, baseDir: str,
|
||||
nickname: str, domain: str, port: int, httpPrefix: str,
|
||||
followNickname: str, followDomain: str,
|
||||
followedActor: str,
|
||||
followPort: int, followHttpPrefix: str,
|
||||
clientToServer: bool, federationList: [],
|
||||
sendThreads: [], postLog: [], cachedWebfingers: {},
|
||||
|
@ -880,6 +881,7 @@ def sendFollowRequest(session, baseDir: str,
|
|||
"""Gets the json object for sending a follow request
|
||||
"""
|
||||
if not domainPermitted(followDomain, federationList):
|
||||
print('You are not permitted to follow the domain ' + followDomain)
|
||||
return None
|
||||
|
||||
fullDomain = getFullDomain(domain, port)
|
||||
|
@ -890,8 +892,7 @@ def sendFollowRequest(session, baseDir: str,
|
|||
statusNumber, published = getStatusNumber()
|
||||
|
||||
if followNickname:
|
||||
followedId = followHttpPrefix + '://' + \
|
||||
requestDomain + '/users/' + followNickname
|
||||
followedId = followedActor
|
||||
followHandle = followNickname + '@' + requestDomain
|
||||
else:
|
||||
if debug:
|
||||
|
|
4
tests.py
4
tests.py
|
@ -849,10 +849,12 @@ def testFollowBetweenServers():
|
|||
alicePersonCache = {}
|
||||
aliceCachedWebfingers = {}
|
||||
alicePostLog = []
|
||||
bobActor = httpPrefix + '://' + bobAddress + '/users/bob'
|
||||
sendResult = \
|
||||
sendFollowRequest(sessionAlice, aliceDir,
|
||||
'alice', aliceDomain, alicePort, httpPrefix,
|
||||
'bob', bobDomain, bobPort, httpPrefix,
|
||||
'bob', bobDomain, bobActor,
|
||||
bobPort, httpPrefix,
|
||||
clientToServer, federationList,
|
||||
aliceSendThreads, alicePostLog,
|
||||
aliceCachedWebfingers, alicePersonCache,
|
||||
|
|
Loading…
Reference in New Issue