mirror of https://gitlab.com/bashrc2/epicyon
Default to false
parent
263e28cbc0
commit
ad1a569c68
12
daemon.py
12
daemon.py
|
@ -10275,7 +10275,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _getFollowingPage(self, baseDir: str, path: str,
|
def _getFollowingJson(self, baseDir: str, path: str,
|
||||||
callingDomain: str,
|
callingDomain: str,
|
||||||
httpPrefix: str,
|
httpPrefix: str,
|
||||||
domain: str, port: int,
|
domain: str, port: int,
|
||||||
|
@ -10285,8 +10285,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
"""
|
"""
|
||||||
followingJson = \
|
followingJson = \
|
||||||
getFollowingFeed(baseDir, domain, port, path, httpPrefix,
|
getFollowingFeed(baseDir, domain, port, path, httpPrefix,
|
||||||
True, followingItemsPerPage)
|
True, followingItemsPerPage, listName)
|
||||||
if not followingJson:
|
if not followingJson:
|
||||||
|
if debug:
|
||||||
|
print(listName + ' json feed not found for ' + path)
|
||||||
self._404()
|
self._404()
|
||||||
return
|
return
|
||||||
msg = json.dumps(followingJson,
|
msg = json.dumps(followingJson,
|
||||||
|
@ -10595,7 +10597,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if authorized and not htmlGET and usersInPath:
|
if authorized and not htmlGET and usersInPath:
|
||||||
if '/following?page=' in self.path:
|
if '/following?page=' in self.path:
|
||||||
self._getFollowingPage(self.server.baseDir,
|
self._getFollowingJson(self.server.baseDir,
|
||||||
self.path,
|
self.path,
|
||||||
callingDomain,
|
callingDomain,
|
||||||
self.server.httpPrefix,
|
self.server.httpPrefix,
|
||||||
|
@ -10605,7 +10607,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.debug, 'following')
|
self.server.debug, 'following')
|
||||||
return
|
return
|
||||||
elif '/followers?page=' in self.path:
|
elif '/followers?page=' in self.path:
|
||||||
self._getFollowingPage(self.server.baseDir,
|
self._getFollowingJson(self.server.baseDir,
|
||||||
self.path,
|
self.path,
|
||||||
callingDomain,
|
callingDomain,
|
||||||
self.server.httpPrefix,
|
self.server.httpPrefix,
|
||||||
|
@ -14552,7 +14554,7 @@ def runDaemon(brochMode: bool,
|
||||||
# for it to be considered dormant?
|
# for it to be considered dormant?
|
||||||
httpd.dormantMonths = dormantMonths
|
httpd.dormantMonths = dormantMonths
|
||||||
|
|
||||||
httpd.followingItemsPerPage = 10
|
httpd.followingItemsPerPage = 12
|
||||||
if registration == 'open':
|
if registration == 'open':
|
||||||
httpd.registration = True
|
httpd.registration = True
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -252,7 +252,7 @@ parser.add_argument('-f', '--federate', nargs='+', dest='federationList',
|
||||||
parser.add_argument("--following", "--following",
|
parser.add_argument("--following", "--following",
|
||||||
dest='following',
|
dest='following',
|
||||||
type=str2bool, nargs='?',
|
type=str2bool, nargs='?',
|
||||||
const=True, default=True,
|
const=True, default=False,
|
||||||
help="Get the following list. Use nickname and " +
|
help="Get the following list. Use nickname and " +
|
||||||
"domain options to specify the account")
|
"domain options to specify the account")
|
||||||
parser.add_argument("--repliesEnabled", "--commentsEnabled",
|
parser.add_argument("--repliesEnabled", "--commentsEnabled",
|
||||||
|
|
10
follow.py
10
follow.py
|
@ -352,14 +352,14 @@ def _getNoOfFollowers(baseDir: str,
|
||||||
|
|
||||||
|
|
||||||
def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
httpPrefix: str, authenticated: bool,
|
httpPrefix: str, authorized: bool,
|
||||||
followsPerPage=12,
|
followsPerPage=12,
|
||||||
followFile='following') -> {}:
|
followFile='following') -> {}:
|
||||||
"""Returns the following and followers feeds from GET requests.
|
"""Returns the following and followers feeds from GET requests.
|
||||||
This accesses the following.txt or followers.txt and builds a collection.
|
This accesses the following.txt or followers.txt and builds a collection.
|
||||||
"""
|
"""
|
||||||
# Show a small number of follows to non-authenticated viewers
|
# Show a small number of follows to non-authorized viewers
|
||||||
if not authenticated:
|
if not authorized:
|
||||||
followsPerPage = 6
|
followsPerPage = 6
|
||||||
|
|
||||||
if '/' + followFile not in path:
|
if '/' + followFile not in path:
|
||||||
|
@ -369,7 +369,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
pageNumber = None
|
pageNumber = None
|
||||||
if '?page=' in path:
|
if '?page=' in path:
|
||||||
pageNumber = path.split('?page=')[1]
|
pageNumber = path.split('?page=')[1]
|
||||||
if pageNumber == 'true' or not authenticated:
|
if pageNumber == 'true' or not authorized:
|
||||||
pageNumber = 1
|
pageNumber = 1
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -401,7 +401,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
httpPrefix + '://' + domain + '/users/' + \
|
httpPrefix + '://' + domain + '/users/' + \
|
||||||
nickname + '/' + followFile
|
nickname + '/' + followFile
|
||||||
totalStr = \
|
totalStr = \
|
||||||
_getNoOfFollows(baseDir, nickname, domain, authenticated)
|
_getNoOfFollows(baseDir, nickname, domain, authorized)
|
||||||
following = {
|
following = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
'first': firstStr,
|
'first': firstStr,
|
||||||
|
|
Loading…
Reference in New Issue