Use the full domain within tokens

main
Bob Mottram 2021-08-05 17:46:02 +01:00
parent 5f10fc9a61
commit a444304eb5
1 changed files with 8 additions and 4 deletions

View File

@ -2677,14 +2677,17 @@ def sendToNamedAddresses(session, baseDir: str,
# another onion domain then switch the clearnet
# domain for the onion one
fromDomain = domain
fromDomainFull = getFullDomain(domain, port)
fromHttpPrefix = httpPrefix
if onionDomain:
if toDomain.endswith('.onion'):
fromDomain = onionDomain
fromDomainFull = onionDomain
fromHttpPrefix = 'http'
elif i2pDomain:
if toDomain.endswith('.i2p'):
fromDomain = i2pDomain
fromDomainFull = i2pDomain
fromHttpPrefix = 'http'
cc = []
@ -2693,8 +2696,8 @@ def sendToNamedAddresses(session, baseDir: str,
# so that it can request a catalog
sharedItemsToken = None
if toDomain in sharedItemsFederatedDomains:
if sharedItemFederationTokens.get(fromDomain):
sharedItemsToken = sharedItemFederationTokens[fromDomain]
if sharedItemFederationTokens.get(fromDomainFull):
sharedItemsToken = sharedItemFederationTokens[fromDomainFull]
groupAccount = hasGroupType(baseDir, address, personCache)
@ -2800,8 +2803,9 @@ def sendToFollowers(session, baseDir: str,
# so that it can request a catalog
sharedItemsToken = None
if followerDomain in sharedItemsFederatedDomains:
if sharedItemFederationTokens.get(domain):
sharedItemsToken = sharedItemFederationTokens[domain]
domainFull = getFullDomain(domain, port)
if sharedItemFederationTokens.get(domainFull):
sharedItemsToken = sharedItemFederationTokens[domainFull]
# check that the follower's domain is active
followerDomainUrl = httpPrefix + '://' + followerDomain