dat becomes hyper

main
Bob Mottram 2021-07-01 18:59:24 +01:00
parent d801482f97
commit ccddb3c765
6 changed files with 10 additions and 12 deletions

View File

@ -1724,7 +1724,7 @@ class PubServer(BaseHTTPRequestHandler):
print('moderationText: ' + moderationText)
nickname = moderationText
if nickname.startswith('http') or \
nickname.startswith('dat'):
nickname.startswith('hyper'):
nickname = getNicknameFromActor(nickname)
if '@' in nickname:
nickname = nickname.split('@')[0]
@ -1739,7 +1739,7 @@ class PubServer(BaseHTTPRequestHandler):
if moderationButton == 'block':
fullBlockDomain = None
if moderationText.startswith('http') or \
moderationText.startswith('dat'):
moderationText.startswith('hyper'):
# https://domain
blockDomain, blockPort = \
getDomainFromActor(moderationText)
@ -1757,7 +1757,7 @@ class PubServer(BaseHTTPRequestHandler):
if moderationButton == 'unblock':
fullBlockDomain = None
if moderationText.startswith('http') or \
moderationText.startswith('dat'):
moderationText.startswith('hyper'):
# https://domain
blockDomain, blockPort = \
getDomainFromActor(moderationText)

View File

@ -1602,9 +1602,7 @@ if args.proxyPort:
setConfigParam(baseDir, 'proxyPort', proxyPort)
if args.gnunet:
httpPrefix = 'gnunet'
if args.dat:
httpPrefix = 'dat'
if args.hyper:
if args.dat or args.hyper:
httpPrefix = 'hyper'
if args.i2p:
httpPrefix = 'http'
@ -1645,7 +1643,7 @@ if args.followers:
if '/@' in args.followers or \
'/users/' in args.followers or \
args.followers.startswith('http') or \
args.followers.startswith('dat'):
args.followers.startswith('hyper'):
# format: https://domain/@nick
prefixes = getProtocolPrefixes()
for prefix in prefixes:

View File

@ -338,7 +338,7 @@ def _getNoOfFollows(baseDir: str, nickname: str, domain: str,
not line.startswith('http'):
ctr += 1
elif ((line.startswith('http') or
line.startswith('dat')) and
line.startswith('hyper')) and
hasUsersPath(line)):
ctr += 1
return ctr
@ -456,7 +456,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
line2.split('@')[0]
following['orderedItems'].append(url)
elif ((line.startswith('http') or
line.startswith('dat')) and
line.startswith('hyper')) and
hasUsersPath(line)):
# https://domain/users/nickname
pageCtr += 1

View File

@ -1208,7 +1208,7 @@ def getActorJson(hostDomain: str, handle: str, http: bool, gnunet: bool,
if '/@' in handle or \
'/users/' in handle or \
handle.startswith('http') or \
handle.startswith('dat'):
handle.startswith('hyper'):
# format: https://domain/@nick
originalHandle = handle
if not hasUsersPath(originalHandle):

View File

@ -1825,7 +1825,7 @@ def createReportPost(baseDir: str,
if moderatorActor not in moderatorsList:
moderatorsList.append(moderatorActor)
continue
if line.startswith('http') or line.startswith('dat'):
if line.startswith('http') or line.startswith('hyper'):
# must be a local address - no remote moderators
if '://' + domainFull + '/' in line:
if line not in moderatorsList:

View File

@ -371,7 +371,7 @@ def load_document(url):
# validate URL
pieces = urllib_parse.urlparse(url)
if (not all([pieces.scheme, pieces.netloc]) or
pieces.scheme not in ['http', 'https', 'dat'] or
pieces.scheme not in ['http', 'https', 'hyper'] or
set(pieces.netloc) > set(
string.ascii_letters + string.digits + '-.:')):
raise JsonLdError(