Check for missing onion domain

main
Bob Mottram 2021-02-28 18:21:12 +00:00
parent a71c548a7f
commit 079c724bb9
2 changed files with 6 additions and 5 deletions

View File

@ -859,8 +859,7 @@ configOnionDomain = getConfigParam(baseDir, 'onion')
if configOnionDomain:
onionDomain = configOnionDomain
else:
# Note: this should not be None
onionDomain = ''
onionDomain = None
# get i2p domain name from configuration
configi2pDomain = getConfigParam(baseDir, 'i2pDomain')
@ -869,7 +868,6 @@ if configi2pDomain:
else:
# Note: this should not be None
i2pDomain = None
onionDomain = ''
# get port number from configuration
configPort = getConfigParam(baseDir, 'port')

View File

@ -1370,8 +1370,11 @@ def _receiveAnnounce(recentPostsCache: {},
YTReplacementDomain,
allowLocalNetworkAccess)
if not postJsonObject:
if domain not in messageJson['object'] and \
onionDomain not in messageJson['object']:
notInOnion = True
if onionDomain:
if onionDomain in messageJson['object']:
notInOnion = False
if domain not in messageJson['object'] and notInOnion:
if os.path.isfile(postFilename):
# if the announce can't be downloaded then remove it
os.remove(postFilename)