mirror of https://gitlab.com/bashrc2/epicyon
dat becomes hyper
parent
d801482f97
commit
ccddb3c765
|
@ -1724,7 +1724,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('moderationText: ' + moderationText)
|
print('moderationText: ' + moderationText)
|
||||||
nickname = moderationText
|
nickname = moderationText
|
||||||
if nickname.startswith('http') or \
|
if nickname.startswith('http') or \
|
||||||
nickname.startswith('dat'):
|
nickname.startswith('hyper'):
|
||||||
nickname = getNicknameFromActor(nickname)
|
nickname = getNicknameFromActor(nickname)
|
||||||
if '@' in nickname:
|
if '@' in nickname:
|
||||||
nickname = nickname.split('@')[0]
|
nickname = nickname.split('@')[0]
|
||||||
|
@ -1739,7 +1739,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if moderationButton == 'block':
|
if moderationButton == 'block':
|
||||||
fullBlockDomain = None
|
fullBlockDomain = None
|
||||||
if moderationText.startswith('http') or \
|
if moderationText.startswith('http') or \
|
||||||
moderationText.startswith('dat'):
|
moderationText.startswith('hyper'):
|
||||||
# https://domain
|
# https://domain
|
||||||
blockDomain, blockPort = \
|
blockDomain, blockPort = \
|
||||||
getDomainFromActor(moderationText)
|
getDomainFromActor(moderationText)
|
||||||
|
@ -1757,7 +1757,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if moderationButton == 'unblock':
|
if moderationButton == 'unblock':
|
||||||
fullBlockDomain = None
|
fullBlockDomain = None
|
||||||
if moderationText.startswith('http') or \
|
if moderationText.startswith('http') or \
|
||||||
moderationText.startswith('dat'):
|
moderationText.startswith('hyper'):
|
||||||
# https://domain
|
# https://domain
|
||||||
blockDomain, blockPort = \
|
blockDomain, blockPort = \
|
||||||
getDomainFromActor(moderationText)
|
getDomainFromActor(moderationText)
|
||||||
|
|
|
@ -1602,9 +1602,7 @@ if args.proxyPort:
|
||||||
setConfigParam(baseDir, 'proxyPort', proxyPort)
|
setConfigParam(baseDir, 'proxyPort', proxyPort)
|
||||||
if args.gnunet:
|
if args.gnunet:
|
||||||
httpPrefix = 'gnunet'
|
httpPrefix = 'gnunet'
|
||||||
if args.dat:
|
if args.dat or args.hyper:
|
||||||
httpPrefix = 'dat'
|
|
||||||
if args.hyper:
|
|
||||||
httpPrefix = 'hyper'
|
httpPrefix = 'hyper'
|
||||||
if args.i2p:
|
if args.i2p:
|
||||||
httpPrefix = 'http'
|
httpPrefix = 'http'
|
||||||
|
@ -1645,7 +1643,7 @@ if args.followers:
|
||||||
if '/@' in args.followers or \
|
if '/@' in args.followers or \
|
||||||
'/users/' in args.followers or \
|
'/users/' in args.followers or \
|
||||||
args.followers.startswith('http') or \
|
args.followers.startswith('http') or \
|
||||||
args.followers.startswith('dat'):
|
args.followers.startswith('hyper'):
|
||||||
# format: https://domain/@nick
|
# format: https://domain/@nick
|
||||||
prefixes = getProtocolPrefixes()
|
prefixes = getProtocolPrefixes()
|
||||||
for prefix in prefixes:
|
for prefix in prefixes:
|
||||||
|
|
|
@ -338,7 +338,7 @@ def _getNoOfFollows(baseDir: str, nickname: str, domain: str,
|
||||||
not line.startswith('http'):
|
not line.startswith('http'):
|
||||||
ctr += 1
|
ctr += 1
|
||||||
elif ((line.startswith('http') or
|
elif ((line.startswith('http') or
|
||||||
line.startswith('dat')) and
|
line.startswith('hyper')) and
|
||||||
hasUsersPath(line)):
|
hasUsersPath(line)):
|
||||||
ctr += 1
|
ctr += 1
|
||||||
return ctr
|
return ctr
|
||||||
|
@ -456,7 +456,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
line2.split('@')[0]
|
line2.split('@')[0]
|
||||||
following['orderedItems'].append(url)
|
following['orderedItems'].append(url)
|
||||||
elif ((line.startswith('http') or
|
elif ((line.startswith('http') or
|
||||||
line.startswith('dat')) and
|
line.startswith('hyper')) and
|
||||||
hasUsersPath(line)):
|
hasUsersPath(line)):
|
||||||
# https://domain/users/nickname
|
# https://domain/users/nickname
|
||||||
pageCtr += 1
|
pageCtr += 1
|
||||||
|
|
|
@ -1208,7 +1208,7 @@ def getActorJson(hostDomain: str, handle: str, http: bool, gnunet: bool,
|
||||||
if '/@' in handle or \
|
if '/@' in handle or \
|
||||||
'/users/' in handle or \
|
'/users/' in handle or \
|
||||||
handle.startswith('http') or \
|
handle.startswith('http') or \
|
||||||
handle.startswith('dat'):
|
handle.startswith('hyper'):
|
||||||
# format: https://domain/@nick
|
# format: https://domain/@nick
|
||||||
originalHandle = handle
|
originalHandle = handle
|
||||||
if not hasUsersPath(originalHandle):
|
if not hasUsersPath(originalHandle):
|
||||||
|
|
2
posts.py
2
posts.py
|
@ -1825,7 +1825,7 @@ def createReportPost(baseDir: str,
|
||||||
if moderatorActor not in moderatorsList:
|
if moderatorActor not in moderatorsList:
|
||||||
moderatorsList.append(moderatorActor)
|
moderatorsList.append(moderatorActor)
|
||||||
continue
|
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
|
# must be a local address - no remote moderators
|
||||||
if '://' + domainFull + '/' in line:
|
if '://' + domainFull + '/' in line:
|
||||||
if line not in moderatorsList:
|
if line not in moderatorsList:
|
||||||
|
|
|
@ -371,7 +371,7 @@ def load_document(url):
|
||||||
# validate URL
|
# validate URL
|
||||||
pieces = urllib_parse.urlparse(url)
|
pieces = urllib_parse.urlparse(url)
|
||||||
if (not all([pieces.scheme, pieces.netloc]) or
|
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(
|
set(pieces.netloc) > set(
|
||||||
string.ascii_letters + string.digits + '-.:')):
|
string.ascii_letters + string.digits + '-.:')):
|
||||||
raise JsonLdError(
|
raise JsonLdError(
|
||||||
|
|
Loading…
Reference in New Issue