Load all lists and then enable them selectively

merge-requests/30/head
Bob Mottram 2021-10-21 20:00:25 +01:00
parent 7d2b5aa1b3
commit 9ecb745d3d
13 changed files with 176 additions and 121 deletions

View File

@ -876,11 +876,9 @@ def brochModeLapses(baseDir: str, lapseDays: int = 7) -> bool:
return False return False
def loadCWLists(baseDir: str, verbose: bool, listsEnabled: str) -> {}: def loadCWLists(baseDir: str, verbose: bool) -> {}:
"""Load lists used for content warnings """Load lists used for content warnings
""" """
if not listsEnabled:
return {}
if not os.path.isdir(baseDir + '/cwlists'): if not os.path.isdir(baseDir + '/cwlists'):
return {} return {}
result = {} result = {}
@ -895,8 +893,6 @@ def loadCWLists(baseDir: str, verbose: bool, listsEnabled: str) -> {}:
continue continue
if not listJson.get('name'): if not listJson.get('name'):
continue continue
if listJson['name'] not in listsEnabled:
continue
if not listJson.get('words') and not listJson.get('domains'): if not listJson.get('words') and not listJson.get('domains'):
continue continue
name = listJson['name'] name = listJson['name']
@ -906,10 +902,13 @@ def loadCWLists(baseDir: str, verbose: bool, listsEnabled: str) -> {}:
return result return result
def addCWfromLists(postJsonObject: {}, CWlists: {}, translate: {}) -> None: def addCWfromLists(postJsonObject: {}, CWlists: {}, translate: {},
listsEnabled: str) -> None:
"""Adds content warnings by matching the post content """Adds content warnings by matching the post content
against domains or keywords against domains or keywords
""" """
if not listsEnabled:
return
if not postJsonObject['object'].get('content'): if not postJsonObject['object'].get('content'):
return return
cw = '' cw = ''
@ -918,6 +917,8 @@ def addCWfromLists(postJsonObject: {}, CWlists: {}, translate: {}) -> None:
content = postJsonObject['object']['content'] content = postJsonObject['object']['content']
for name, item in CWlists.items(): for name, item in CWlists.items():
if name not in listsEnabled:
continue
if not item.get('warning'): if not item.get('warning'):
continue continue
warning = item['warning'] warning = item['warning']

108
daemon.py
View File

@ -1231,7 +1231,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.themeName, self.server.themeName,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.maxRecentPosts, self.server.maxRecentPosts,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
def _postToOutboxThread(self, messageJson: {}) -> bool: def _postToOutboxThread(self, messageJson: {}) -> bool:
"""Creates a thread to send a post """Creates a thread to send a post
@ -3010,7 +3011,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if hashtagStr: if hashtagStr:
msg = hashtagStr.encode('utf-8') msg = hashtagStr.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -3069,7 +3071,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if historyStr: if historyStr:
msg = historyStr.encode('utf-8') msg = historyStr.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -3108,7 +3111,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if bookmarksStr: if bookmarksStr:
msg = bookmarksStr.encode('utf-8') msg = bookmarksStr.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -3213,7 +3217,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
signingPrivateKeyPem, signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if profileStr: if profileStr:
msg = profileStr.encode('utf-8') msg = profileStr.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -6734,7 +6739,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if hashtagStr: if hashtagStr:
msg = hashtagStr.encode('utf-8') msg = hashtagStr.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -6957,7 +6963,8 @@ class PubServer(BaseHTTPRequestHandler):
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, False, True, False,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
self.server.GETbusy = False self.server.GETbusy = False
actorAbsolute = self._getInstanceUrl(callingDomain) + actor actorAbsolute = self._getInstanceUrl(callingDomain) + actor
@ -7439,7 +7446,8 @@ class PubServer(BaseHTTPRequestHandler):
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, False, True, False,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Liked post not found: ' + likedPostFilename) print('WARN: Liked post not found: ' + likedPostFilename)
# clear the icon from the cache so that it gets updated # clear the icon from the cache so that it gets updated
@ -7600,7 +7608,8 @@ class PubServer(BaseHTTPRequestHandler):
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, False, True, False,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Unliked post not found: ' + likedPostFilename) print('WARN: Unliked post not found: ' + likedPostFilename)
# clear the icon from the cache so that it gets updated # clear the icon from the cache so that it gets updated
@ -7736,7 +7745,8 @@ class PubServer(BaseHTTPRequestHandler):
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, False, True, False,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Bookmarked post not found: ' + bookmarkFilename) print('WARN: Bookmarked post not found: ' + bookmarkFilename)
# self._postToOutbox(bookmarkJson, self.server.projectVersion, None) # self._postToOutbox(bookmarkJson, self.server.projectVersion, None)
@ -7871,7 +7881,8 @@ class PubServer(BaseHTTPRequestHandler):
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, False, True, False,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Unbookmarked post not found: ' + bookmarkFilename) print('WARN: Unbookmarked post not found: ' + bookmarkFilename)
self.server.GETbusy = False self.server.GETbusy = False
@ -7974,7 +7985,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if deleteStr: if deleteStr:
deleteStrLen = len(deleteStr) deleteStrLen = len(deleteStr)
self._set_headers('text/html', deleteStrLen, self._set_headers('text/html', deleteStrLen,
@ -8083,7 +8095,8 @@ class PubServer(BaseHTTPRequestHandler):
manuallyApproveFollowers, manuallyApproveFollowers,
showPublicOnly, storeToCache, showPublicOnly, storeToCache,
useCacheOnly, useCacheOnly,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Muted post not found: ' + muteFilename) print('WARN: Muted post not found: ' + muteFilename)
@ -8193,7 +8206,8 @@ class PubServer(BaseHTTPRequestHandler):
manuallyApproveFollowers, manuallyApproveFollowers,
showPublicOnly, storeToCache, showPublicOnly, storeToCache,
useCacheOnly, useCacheOnly,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
else: else:
print('WARN: Unmuted post not found: ' + muteFilename) print('WARN: Unmuted post not found: ' + muteFilename)
self.server.GETbusy = False self.server.GETbusy = False
@ -8317,7 +8331,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -8417,7 +8432,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -8526,7 +8542,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
rolesList, rolesList,
None, None, self.server.CWlists) None, None, self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -8640,7 +8657,8 @@ class PubServer(BaseHTTPRequestHandler):
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
skills, skills,
None, None, None, None,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -8790,7 +8808,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.systemLanguage, self.server.systemLanguage,
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9037,7 +9056,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
if GETstartTime: if GETstartTime:
fitnessPerformance(GETstartTime, fitnessPerformance(GETstartTime,
self.server.fitness, self.server.fitness,
@ -9186,7 +9206,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9328,7 +9349,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9469,7 +9491,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9610,7 +9633,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9760,7 +9784,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -9908,7 +9933,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10015,7 +10041,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10100,7 +10127,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10222,7 +10250,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10361,7 +10390,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10491,7 +10521,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
sharedItemsFederatedDomains, sharedItemsFederatedDomains,
self.server.signingPrivateKeyPem, self.server.signingPrivateKeyPem,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10619,7 +10650,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
shares, shares,
pageNumber, sharesPerPage, pageNumber, sharesPerPage,
self.server.CWlists) self.server.CWlists,
self.server.listsEnabled)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
@ -10744,7 +10776,8 @@ class PubServer(BaseHTTPRequestHandler):
following, following,
pageNumber, pageNumber,
followsPerPage, followsPerPage,
self.server.CWlists).encode('utf-8') self.server.CWlists,
self.server.listsEnabled).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', self._set_headers('text/html',
msglen, cookie, callingDomain, False) msglen, cookie, callingDomain, False)
@ -10868,7 +10901,8 @@ class PubServer(BaseHTTPRequestHandler):
followers, followers,
pageNumber, pageNumber,
followsPerPage, followsPerPage,
self.server.CWlists).encode('utf-8') self.server.CWlists,
self.server.listsEnabled).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
cookie, callingDomain, False) cookie, callingDomain, False)
@ -11008,7 +11042,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.maxLikeCount, self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains, self.server.sharedItemsFederatedDomains,
None, None, None, None, None, None,
self.server.CWlists).encode('utf-8') self.server.CWlists,
self.server.listsEnabled).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
cookie, callingDomain, False) cookie, callingDomain, False)
@ -17226,8 +17261,7 @@ def runDaemon(listsEnabled: str,
httpd.listsEnabled = listsEnabled httpd.listsEnabled = listsEnabled
else: else:
httpd.listsEnabled = getConfigParam(baseDir, "listsEnabled") httpd.listsEnabled = getConfigParam(baseDir, "listsEnabled")
httpd.CWlists = loadCWLists(baseDir, True, httpd.listsEnabled) httpd.CWlists = loadCWLists(baseDir, True)
print('CWlistsStr httpd.CWlists: ' + str(httpd.CWlists))
# set the avatar for the news account # set the avatar for the news account
httpd.themeName = getConfigParam(baseDir, 'theme') httpd.themeName = getConfigParam(baseDir, 'theme')

View File

@ -275,7 +275,8 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> None: CWlists: {},
listsEnabled: str) -> None:
"""Converts the json post into html and stores it in a cache """Converts the json post into html and stores it in a cache
This enables the post to be quickly displayed later This enables the post to be quickly displayed later
""" """
@ -300,7 +301,7 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
peertubeInstances, allowLocalNetworkAccess, peertubeInstances, allowLocalNetworkAccess,
themeName, systemLanguage, maxLikeCount, themeName, systemLanguage, maxLikeCount,
notDM, True, True, False, True, False, notDM, True, True, False, True, False,
CWlists) CWlists, listsEnabled)
def validInbox(baseDir: str, nickname: str, domain: str) -> bool: def validInbox(baseDir: str, nickname: str, domain: str) -> bool:
@ -982,7 +983,8 @@ def _receiveLike(recentPostsCache: {},
peertubeInstances: [], peertubeInstances: [],
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, CWlists: {}) -> bool: maxLikeCount: int, CWlists: {},
listsEnabled: str) -> bool:
"""Receives a Like activity within the POST section of HTTPServer """Receives a Like activity within the POST section of HTTPServer
""" """
if messageJson['type'] != 'Like': if messageJson['type'] != 'Like':
@ -1084,7 +1086,8 @@ def _receiveLike(recentPostsCache: {},
maxLikeCount, notDM, maxLikeCount, notDM,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, CWlists) False, True, False, CWlists,
listsEnabled)
return True return True
@ -1102,7 +1105,8 @@ def _receiveUndoLike(recentPostsCache: {},
peertubeInstances: [], peertubeInstances: [],
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, CWlists: {}) -> bool: maxLikeCount: int, CWlists: {},
listsEnabled: str) -> bool:
"""Receives an undo like activity within the POST section of HTTPServer """Receives an undo like activity within the POST section of HTTPServer
""" """
if messageJson['type'] != 'Undo': if messageJson['type'] != 'Undo':
@ -1193,7 +1197,8 @@ def _receiveUndoLike(recentPostsCache: {},
maxLikeCount, notDM, maxLikeCount, notDM,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, CWlists) False, True, False, CWlists,
listsEnabled)
return True return True
@ -1210,7 +1215,8 @@ def _receiveBookmark(recentPostsCache: {},
peertubeInstances: [], peertubeInstances: [],
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, CWlists: {}) -> bool: maxLikeCount: int, CWlists: {},
listsEnabled: {}) -> bool:
"""Receives a bookmark activity within the POST section of HTTPServer """Receives a bookmark activity within the POST section of HTTPServer
""" """
if not messageJson.get('type'): if not messageJson.get('type'):
@ -1301,7 +1307,8 @@ def _receiveBookmark(recentPostsCache: {},
maxLikeCount, notDM, maxLikeCount, notDM,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, CWlists) False, True, False, CWlists,
listsEnabled)
return True return True
@ -1318,7 +1325,8 @@ def _receiveUndoBookmark(recentPostsCache: {},
peertubeInstances: [], peertubeInstances: [],
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, CWlists: {}) -> bool: maxLikeCount: int, CWlists: {},
listsEnabled: str) -> bool:
"""Receives an undo bookmark activity within the POST section of HTTPServer """Receives an undo bookmark activity within the POST section of HTTPServer
""" """
if not messageJson.get('type'): if not messageJson.get('type'):
@ -1410,7 +1418,7 @@ def _receiveUndoBookmark(recentPostsCache: {},
maxLikeCount, notDM, maxLikeCount, notDM,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, CWlists) False, True, False, CWlists, listsEnabled)
return True return True
@ -1504,7 +1512,8 @@ def _receiveAnnounce(recentPostsCache: {},
maxRecentPosts: int, maxRecentPosts: int,
allowDeletion: bool, allowDeletion: bool,
peertubeInstances: [], peertubeInstances: [],
maxLikeCount: int, CWlists: {}) -> bool: maxLikeCount: int, CWlists: {},
listsEnabled: str) -> bool:
"""Receives an announce activity within the POST section of HTTPServer """Receives an announce activity within the POST section of HTTPServer
""" """
if messageJson['type'] != 'Announce': if messageJson['type'] != 'Announce':
@ -1616,7 +1625,8 @@ def _receiveAnnounce(recentPostsCache: {},
maxLikeCount, notDM, maxLikeCount, notDM,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, False, CWlists) False, True, False, CWlists,
listsEnabled)
if not announceHtml: if not announceHtml:
print('WARN: Unable to generate html for announce ' + print('WARN: Unable to generate html for announce ' +
str(messageJson)) str(messageJson))
@ -2554,7 +2564,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
defaultReplyIntervalHours: int, defaultReplyIntervalHours: int,
CWlists: {}) -> bool: CWlists: {}, listsEnabled: str) -> bool:
""" Anything which needs to be done after initial checks have passed """ Anything which needs to be done after initial checks have passed
""" """
actor = keyId actor = keyId
@ -2584,7 +2594,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
peertubeInstances, peertubeInstances,
allowLocalNetworkAccess, allowLocalNetworkAccess,
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, CWlists): maxLikeCount, CWlists, listsEnabled):
if debug: if debug:
print('DEBUG: Like accepted from ' + actor) print('DEBUG: Like accepted from ' + actor)
return False return False
@ -2606,7 +2616,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
peertubeInstances, peertubeInstances,
allowLocalNetworkAccess, allowLocalNetworkAccess,
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, CWlists): maxLikeCount, CWlists, listsEnabled):
if debug: if debug:
print('DEBUG: Undo like accepted from ' + actor) print('DEBUG: Undo like accepted from ' + actor)
return False return False
@ -2628,7 +2638,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
peertubeInstances, peertubeInstances,
allowLocalNetworkAccess, allowLocalNetworkAccess,
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, CWlists): maxLikeCount, CWlists, listsEnabled):
if debug: if debug:
print('DEBUG: Bookmark accepted from ' + actor) print('DEBUG: Bookmark accepted from ' + actor)
return False return False
@ -2650,7 +2660,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
peertubeInstances, peertubeInstances,
allowLocalNetworkAccess, allowLocalNetworkAccess,
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, CWlists): maxLikeCount, CWlists, listsEnabled):
if debug: if debug:
print('DEBUG: Undo bookmark accepted from ' + actor) print('DEBUG: Undo bookmark accepted from ' + actor)
return False return False
@ -2676,7 +2686,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
maxRecentPosts, maxRecentPosts,
allowDeletion, allowDeletion,
peertubeInstances, peertubeInstances,
maxLikeCount, CWlists): maxLikeCount, CWlists, listsEnabled):
if debug: if debug:
print('DEBUG: Announce accepted from ' + actor) print('DEBUG: Announce accepted from ' + actor)
@ -2958,7 +2968,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, maxLikeCount,
signingPrivateKeyPem, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
if debug: if debug:
timeDiff = \ timeDiff = \
str(int((time.time() - htmlCacheStartTime) * str(int((time.time() - htmlCacheStartTime) *
@ -3631,6 +3641,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
if not os.path.isfile(sharedInboxPostFilename): if not os.path.isfile(sharedInboxPostFilename):
saveJson(queueJson['post'], sharedInboxPostFilename) saveJson(queueJson['post'], sharedInboxPostFilename)
listsEnabled = getConfigParam(baseDir, "listsEnabled")
# for posts addressed to specific accounts # for posts addressed to specific accounts
for handle, capsId in recipientsDict.items(): for handle, capsId in recipientsDict.items():
destination = \ destination = \
@ -3662,7 +3674,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
maxLikeCount, maxLikeCount,
signingPrivateKeyPem, signingPrivateKeyPem,
defaultReplyIntervalHours, defaultReplyIntervalHours,
CWlists) CWlists, listsEnabled)
if debug: if debug:
pprint(queueJson['post']) pprint(queueJson['post'])
print('Queue: Queue post accepted') print('Queue: Queue post accepted')

View File

@ -196,7 +196,8 @@ def postMessageToOutbox(session, translate: {},
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
peertubeInstances: str, theme: str, peertubeInstances: str, theme: str,
maxLikeCount: int, maxLikeCount: int,
maxRecentPosts: int, CWlists: {}) -> bool: maxRecentPosts: int, CWlists: {},
listsEnabled: str) -> bool:
"""post is received by the outbox """post is received by the outbox
Client to server message post Client to server message post
https://www.w3.org/TR/activitypub/#client-to-server-outbox-delivery https://www.w3.org/TR/activitypub/#client-to-server-outbox-delivery
@ -468,7 +469,7 @@ def postMessageToOutbox(session, translate: {},
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, useCacheOnly, False, True, useCacheOnly,
CWlists) CWlists, listsEnabled)
if outboxAnnounce(recentPostsCache, if outboxAnnounce(recentPostsCache,
baseDir, messageJson, debug): baseDir, messageJson, debug):

View File

@ -125,7 +125,8 @@ def _updatePostSchedule(baseDir: str, handle: str, httpd,
httpd.themeName, httpd.themeName,
httpd.maxLikeCount, httpd.maxLikeCount,
httpd.maxRecentPosts, httpd.maxRecentPosts,
httpd.CWlists): httpd.CWlists,
httpd.listsEnabled):
indexLines.remove(line) indexLines.remove(line)
try: try:
os.remove(postFilename) os.remove(postFilename)

View File

@ -5773,7 +5773,7 @@ def _testWordsSimilarity() -> None:
def _testAddCWfromLists(baseDir: str) -> None: def _testAddCWfromLists(baseDir: str) -> None:
print('testAddCWfromLists') print('testAddCWfromLists')
translate = {} translate = {}
CWlists = loadCWLists(baseDir, True, "Murdoch press") CWlists = loadCWLists(baseDir, True)
assert CWlists assert CWlists
postJsonObject = { postJsonObject = {
@ -5783,7 +5783,7 @@ def _testAddCWfromLists(baseDir: str) -> None:
"content": "" "content": ""
} }
} }
addCWfromLists(postJsonObject, CWlists, translate) addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
assert postJsonObject['object']['sensitive'] is False assert postJsonObject['object']['sensitive'] is False
assert postJsonObject['object']['summary'] is None assert postJsonObject['object']['summary'] is None
@ -5794,7 +5794,7 @@ def _testAddCWfromLists(baseDir: str) -> None:
"content": "Blah blah news.co.uk blah blah" "content": "Blah blah news.co.uk blah blah"
} }
} }
addCWfromLists(postJsonObject, CWlists, translate) addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
assert postJsonObject['object']['sensitive'] is True assert postJsonObject['object']['sensitive'] is True
assert postJsonObject['object']['summary'] == "Murdoch Press" assert postJsonObject['object']['summary'] == "Murdoch Press"
@ -5805,7 +5805,7 @@ def _testAddCWfromLists(baseDir: str) -> None:
"content": "Blah blah news.co.uk blah blah" "content": "Blah blah news.co.uk blah blah"
} }
} }
addCWfromLists(postJsonObject, CWlists, translate) addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
assert postJsonObject['object']['sensitive'] is True assert postJsonObject['object']['sensitive'] is True
assert postJsonObject['object']['summary'] == "Murdoch Press / Existing CW" assert postJsonObject['object']['summary'] == "Murdoch Press / Existing CW"

View File

@ -36,7 +36,7 @@ def htmlConfirmDelete(cssCache: {},
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, signingPrivateKeyPem: str, maxLikeCount: int, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Shows a screen asking to confirm the deletion of a post """Shows a screen asking to confirm the deletion of a post
""" """
if '/statuses/' not in messageId: if '/statuses/' not in messageId:
@ -81,7 +81,7 @@ def htmlConfirmDelete(cssCache: {},
peertubeInstances, allowLocalNetworkAccess, peertubeInstances, allowLocalNetworkAccess,
themeName, systemLanguage, maxLikeCount, themeName, systemLanguage, maxLikeCount,
False, False, False, False, False, False, False, False, False, False, False, False,
CWlists) CWlists, listsEnabled)
deletePostStr += '<center>' deletePostStr += '<center>'
deletePostStr += \ deletePostStr += \
' <p class="followText">' + \ ' <p class="followText">' + \

View File

@ -35,7 +35,8 @@ def _htmlFrontScreenPosts(recentPostsCache: {}, maxRecentPosts: int,
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, CWlists: {}) -> str: signingPrivateKeyPem: str, CWlists: {},
listsEnabled: str) -> str:
"""Shows posts on the front screen of a news instance """Shows posts on the front screen of a news instance
These should only be public blog posts from the features timeline These should only be public blog posts from the features timeline
which is the blog timeline of the news actor which is the blog timeline of the news actor
@ -82,7 +83,7 @@ def _htmlFrontScreenPosts(recentPostsCache: {}, maxRecentPosts: int,
maxLikeCount, maxLikeCount,
False, False, False, False, False, False,
True, False, False, True, False, False,
CWlists) CWlists, listsEnabled)
if postStr: if postStr:
profileStr += postStr + separatorStr profileStr += postStr + separatorStr
ctr += 1 ctr += 1
@ -113,7 +114,7 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
extraJson: {}, extraJson: {},
pageNumber: int, pageNumber: int,
maxItemsPerPage: int, maxItemsPerPage: int,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the news instance front screen """Show the news instance front screen
""" """
nickname = profileJson['preferredUsername'] nickname = profileJson['preferredUsername']
@ -185,7 +186,7 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
theme, systemLanguage, theme, systemLanguage,
maxLikeCount, maxLikeCount,
signingPrivateKeyPem, signingPrivateKeyPem,
CWlists) + licenseStr CWlists, listsEnabled) + licenseStr
# Footer which is only used for system accounts # Footer which is only used for system accounts
profileFooterStr = ' </td>\n' profileFooterStr = ' </td>\n'

View File

@ -53,7 +53,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the moderation feed as html """Show the moderation feed as html
This is what you see when selecting the "mod" timeline This is what you see when selecting the "mod" timeline
""" """
@ -73,7 +73,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
peertubeInstances, allowLocalNetworkAccess, peertubeInstances, allowLocalNetworkAccess,
textModeBanner, accessKeys, systemLanguage, textModeBanner, accessKeys, systemLanguage,
maxLikeCount, sharedItemsFederatedDomains, maxLikeCount, sharedItemsFederatedDomains,
signingPrivateKeyPem, CWlists) signingPrivateKeyPem, CWlists, listsEnabled)
def htmlAccountInfo(cssCache: {}, translate: {}, def htmlAccountInfo(cssCache: {}, translate: {},

View File

@ -1207,7 +1207,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
showPublicOnly: bool, showPublicOnly: bool,
storeToCache: bool, storeToCache: bool,
useCacheOnly: bool, useCacheOnly: bool,
CWlists: {}) -> str: CWlists: {},
listsEnabled: str) -> str:
""" Shows a single post as html """ Shows a single post as html
""" """
if not postJsonObject: if not postJsonObject:
@ -1654,7 +1655,7 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
footerStr = newFooterStr footerStr = newFooterStr
# add any content warning from the cwlists directory # add any content warning from the cwlists directory
addCWfromLists(postJsonObject, CWlists, translate) addCWfromLists(postJsonObject, CWlists, translate, listsEnabled)
postIsSensitive = False postIsSensitive = False
if postJsonObject['object'].get('sensitive'): if postJsonObject['object'].get('sensitive'):
@ -1831,7 +1832,7 @@ def htmlIndividualPost(cssCache: {},
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, signingPrivateKeyPem: str, maxLikeCount: int, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show an individual post as html """Show an individual post as html
""" """
postStr = '' postStr = ''
@ -1885,7 +1886,7 @@ def htmlIndividualPost(cssCache: {},
allowLocalNetworkAccess, themeName, allowLocalNetworkAccess, themeName,
systemLanguage, maxLikeCount, systemLanguage, maxLikeCount,
False, authorized, False, False, False, False, False, authorized, False, False, False, False,
CWlists) CWlists, listsEnabled)
messageId = removeIdEnding(postJsonObject['id']) messageId = removeIdEnding(postJsonObject['id'])
# show the previous posts # show the previous posts
@ -1918,7 +1919,7 @@ def htmlIndividualPost(cssCache: {},
maxLikeCount, maxLikeCount,
False, authorized, False, authorized,
False, False, False, False, False, False, False, False,
CWlists) + postStr CWlists, listsEnabled) + postStr
# show the following posts # show the following posts
postFilename = locatePost(baseDir, nickname, domain, messageId) postFilename = locatePost(baseDir, nickname, domain, messageId)
@ -1953,7 +1954,7 @@ def htmlIndividualPost(cssCache: {},
maxLikeCount, maxLikeCount,
False, authorized, False, authorized,
False, False, False, False, False, False, False, False,
CWlists) CWlists, listsEnabled)
cssFilename = baseDir + '/epicyon-profile.css' cssFilename = baseDir + '/epicyon-profile.css'
if os.path.isfile(baseDir + '/epicyon.css'): if os.path.isfile(baseDir + '/epicyon.css'):
cssFilename = baseDir + '/epicyon.css' cssFilename = baseDir + '/epicyon.css'
@ -1977,7 +1978,8 @@ def htmlPostReplies(cssCache: {},
allowLocalNetworkAccess: bool, allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, CWlists: {}) -> str: signingPrivateKeyPem: str, CWlists: {},
listsEnabled: str) -> str:
"""Show the replies to an individual post as html """Show the replies to an individual post as html
""" """
repliesStr = '' repliesStr = ''
@ -2001,7 +2003,7 @@ def htmlPostReplies(cssCache: {},
themeName, systemLanguage, themeName, systemLanguage,
maxLikeCount, maxLikeCount,
False, False, False, False, False, False, False, False, False, False, False, False,
CWlists) CWlists, listsEnabled)
cssFilename = baseDir + '/epicyon-profile.css' cssFilename = baseDir + '/epicyon-profile.css'
if os.path.isfile(baseDir + '/epicyon.css'): if os.path.isfile(baseDir + '/epicyon.css'):

View File

@ -90,7 +90,7 @@ def htmlProfileAfterSearch(cssCache: {},
systemLanguage: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show a profile page after a search for a fediverse address """Show a profile page after a search for a fediverse address
""" """
http = False http = False
@ -308,7 +308,7 @@ def htmlProfileAfterSearch(cssCache: {},
allowLocalNetworkAccess, allowLocalNetworkAccess,
themeName, systemLanguage, maxLikeCount, themeName, systemLanguage, maxLikeCount,
False, False, False, False, False, False, False, False, False, False, False, False,
CWlists) CWlists, listsEnabled)
i += 1 i += 1
if i >= 8: if i >= 8:
break break
@ -520,7 +520,7 @@ def htmlProfile(signingPrivateKeyPem: str,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
extraJson: {}, pageNumber: int, extraJson: {}, pageNumber: int,
maxItemsPerPage: int, maxItemsPerPage: int,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the profile page as html """Show the profile page as html
""" """
nickname = profileJson['preferredUsername'] nickname = profileJson['preferredUsername']
@ -543,7 +543,8 @@ def htmlProfile(signingPrivateKeyPem: str,
allowLocalNetworkAccess, accessKeys, allowLocalNetworkAccess, accessKeys,
systemLanguage, maxLikeCount, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, None, sharedItemsFederatedDomains, None,
pageNumber, maxItemsPerPage, CWlists) pageNumber, maxItemsPerPage, CWlists,
listsEnabled)
domain, port = getDomainFromActor(profileJson['id']) domain, port = getDomainFromActor(profileJson['id'])
if not domain: if not domain:
@ -901,7 +902,7 @@ def htmlProfile(signingPrivateKeyPem: str,
theme, systemLanguage, theme, systemLanguage,
maxLikeCount, maxLikeCount,
signingPrivateKeyPem, signingPrivateKeyPem,
CWlists) + licenseStr CWlists, listsEnabled) + licenseStr
if not isGroup: if not isGroup:
if selected == 'following': if selected == 'following':
profileStr += \ profileStr += \
@ -968,7 +969,7 @@ def _htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Shows posts on the profile screen """Shows posts on the profile screen
These should only be public posts These should only be public posts
""" """
@ -1014,7 +1015,7 @@ def _htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
maxLikeCount, maxLikeCount,
False, False, False, False, False, False,
True, False, False, True, False, False,
CWlists) CWlists, listsEnabled)
if postStr: if postStr:
profileStr += postStr + separatorStr profileStr += postStr + separatorStr
ctr += 1 ctr += 1

View File

@ -599,7 +599,8 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
systemLanguage: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {},
listsEnabled: str) -> str:
"""Show a page containing search results for your post history """Show a page containing search results for your post history
""" """
if historysearch.startswith("'"): if historysearch.startswith("'"):
@ -685,7 +686,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
showIndividualPostIcons, showIndividualPostIcons,
showIndividualPostIcons, showIndividualPostIcons,
False, False, False, False, False, False, False, False,
CWlists) CWlists, listsEnabled)
if postStr: if postStr:
historySearchForm += separatorStr + postStr historySearchForm += separatorStr + postStr
index += 1 index += 1
@ -710,7 +711,7 @@ def htmlHashtagSearch(cssCache: {},
themeName: str, systemLanguage: str, themeName: str, systemLanguage: str,
maxLikeCount: int, maxLikeCount: int,
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show a page containing search results for a hashtag """Show a page containing search results for a hashtag
or after selecting a hashtag from the swarm or after selecting a hashtag from the swarm
""" """
@ -868,7 +869,8 @@ def htmlHashtagSearch(cssCache: {},
showRepeats, showIcons, showRepeats, showIcons,
manuallyApprovesFollowers, manuallyApprovesFollowers,
showPublicOnly, showPublicOnly,
storeToCache, False, CWlists) storeToCache, False, CWlists,
listsEnabled)
if postStr: if postStr:
hashtagSearchForm += separatorStr + postStr hashtagSearchForm += separatorStr + postStr
index += 1 index += 1

View File

@ -447,7 +447,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the timeline as html """Show the timeline as html
""" """
enableTimingLog = False enableTimingLog = False
@ -915,7 +915,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True, useCacheOnly, False, True, useCacheOnly,
CWlists) CWlists, listsEnabled)
_logTimelineTiming(enableTimingLog, _logTimelineTiming(enableTimingLog,
timelineStartTime, boxName, '12') timelineStartTime, boxName, '12')
@ -1140,7 +1140,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the shares timeline as html """Show the shares timeline as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1166,7 +1166,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlWanted(cssCache: {}, defaultTimeline: str, def htmlWanted(cssCache: {}, defaultTimeline: str,
@ -1194,7 +1194,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the wanted timeline as html """Show the wanted timeline as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1220,7 +1220,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInbox(cssCache: {}, defaultTimeline: str, def htmlInbox(cssCache: {}, defaultTimeline: str,
@ -1249,7 +1249,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the inbox as html """Show the inbox as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1275,7 +1275,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlBookmarks(cssCache: {}, defaultTimeline: str, def htmlBookmarks(cssCache: {}, defaultTimeline: str,
@ -1304,7 +1304,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the bookmarks as html """Show the bookmarks as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1330,7 +1330,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxDMs(cssCache: {}, defaultTimeline: str, def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
@ -1359,7 +1359,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the DM timeline as html """Show the DM timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1380,7 +1380,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxReplies(cssCache: {}, defaultTimeline: str, def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
@ -1409,7 +1409,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the replies timeline as html """Show the replies timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1431,7 +1431,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxMedia(cssCache: {}, defaultTimeline: str, def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
@ -1460,7 +1460,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the media timeline as html """Show the media timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1482,7 +1482,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str, def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
@ -1511,7 +1511,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the blogs timeline as html """Show the blogs timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1533,7 +1533,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str, def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
@ -1563,7 +1563,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the features timeline as html """Show the features timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1585,7 +1585,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlInboxNews(cssCache: {}, defaultTimeline: str, def htmlInboxNews(cssCache: {}, defaultTimeline: str,
@ -1614,7 +1614,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the news timeline as html """Show the news timeline as html
""" """
return htmlTimeline(cssCache, defaultTimeline, return htmlTimeline(cssCache, defaultTimeline,
@ -1636,7 +1636,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)
def htmlOutbox(cssCache: {}, defaultTimeline: str, def htmlOutbox(cssCache: {}, defaultTimeline: str,
@ -1665,7 +1665,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
maxLikeCount: int, maxLikeCount: int,
sharedItemsFederatedDomains: [], sharedItemsFederatedDomains: [],
signingPrivateKeyPem: str, signingPrivateKeyPem: str,
CWlists: {}) -> str: CWlists: {}, listsEnabled: str) -> str:
"""Show the Outbox as html """Show the Outbox as html
""" """
manuallyApproveFollowers = \ manuallyApproveFollowers = \
@ -1688,4 +1688,4 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
allowLocalNetworkAccess, textModeBanner, allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount, accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem, sharedItemsFederatedDomains, signingPrivateKeyPem,
CWlists) CWlists, listsEnabled)