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