mirror of https://gitlab.com/bashrc2/epicyon
merge
commit
c38094f7e5
91
blocking.py
91
blocking.py
|
|
@ -874,3 +874,94 @@ def brochModeLapses(baseDir: str, lapseDays: int = 7) -> bool:
|
||||||
print('Broch mode has elapsed')
|
print('Broch mode has elapsed')
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def loadCWLists(baseDir: str, verbose: bool) -> {}:
|
||||||
|
"""Load lists used for content warnings
|
||||||
|
"""
|
||||||
|
if not os.path.isdir(baseDir + '/cwlists'):
|
||||||
|
return {}
|
||||||
|
result = {}
|
||||||
|
for subdir, dirs, files in os.walk(baseDir + '/cwlists'):
|
||||||
|
for f in files:
|
||||||
|
if not f.endswith('.json'):
|
||||||
|
continue
|
||||||
|
listFilename = os.path.join(baseDir + '/cwlists', f)
|
||||||
|
print('listFilename: ' + listFilename)
|
||||||
|
listJson = loadJson(listFilename, 0, 1)
|
||||||
|
if not listJson:
|
||||||
|
continue
|
||||||
|
if not listJson.get('name'):
|
||||||
|
continue
|
||||||
|
if not listJson.get('words') and not listJson.get('domains'):
|
||||||
|
continue
|
||||||
|
name = listJson['name']
|
||||||
|
if verbose:
|
||||||
|
print('List: ' + name)
|
||||||
|
result[name] = listJson
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def addCWfromLists(postJsonObject: {}, CWlists: {}, translate: {},
|
||||||
|
listsEnabled: str) -> None:
|
||||||
|
"""Adds content warnings by matching the post content
|
||||||
|
against domains or keywords
|
||||||
|
"""
|
||||||
|
if not listsEnabled:
|
||||||
|
return
|
||||||
|
if not postJsonObject['object'].get('content'):
|
||||||
|
return
|
||||||
|
cw = ''
|
||||||
|
if postJsonObject['object'].get('summary'):
|
||||||
|
cw = postJsonObject['object']['summary']
|
||||||
|
|
||||||
|
content = postJsonObject['object']['content']
|
||||||
|
for name, item in CWlists.items():
|
||||||
|
if name not in listsEnabled:
|
||||||
|
continue
|
||||||
|
if not item.get('warning'):
|
||||||
|
continue
|
||||||
|
warning = item['warning']
|
||||||
|
|
||||||
|
# is there a translated version of the warning?
|
||||||
|
if translate.get(warning):
|
||||||
|
warning = translate[warning]
|
||||||
|
|
||||||
|
# is the warning already in the CW?
|
||||||
|
if warning in cw:
|
||||||
|
continue
|
||||||
|
|
||||||
|
matched = False
|
||||||
|
|
||||||
|
# match domains within the content
|
||||||
|
if item.get('domains'):
|
||||||
|
for domain in item['domains']:
|
||||||
|
if domain in content:
|
||||||
|
if cw:
|
||||||
|
cw = warning + ' / ' + cw
|
||||||
|
else:
|
||||||
|
cw = warning
|
||||||
|
matched = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if matched:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# match words within the content
|
||||||
|
if item.get('words'):
|
||||||
|
for wordStr in item['words']:
|
||||||
|
if wordStr in content:
|
||||||
|
if cw:
|
||||||
|
cw = warning + ' / ' + cw
|
||||||
|
else:
|
||||||
|
cw = warning
|
||||||
|
break
|
||||||
|
if cw:
|
||||||
|
postJsonObject['object']['summary'] = cw
|
||||||
|
postJsonObject['object']['sensitive'] = True
|
||||||
|
|
||||||
|
|
||||||
|
def getCWlistVariable(listName: str) -> str:
|
||||||
|
"""Returns the variable associated with a CW list
|
||||||
|
"""
|
||||||
|
return 'list' + listName.replace(' ', '').replace("'", '')
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"name": "Murdoch press",
|
||||||
|
"warning": "Murdoch Press",
|
||||||
|
"words": [],
|
||||||
|
"domains": [
|
||||||
|
"api.news",
|
||||||
|
"content.api.news",
|
||||||
|
"newscdn.com.au",
|
||||||
|
"resourcesssl.newscdn.com.au",
|
||||||
|
"thesun.co.uk",
|
||||||
|
"thetimes.co.uk",
|
||||||
|
"thesundaytimes.co.uk",
|
||||||
|
"pressassociation.com",
|
||||||
|
"news.co.uk",
|
||||||
|
"newscorpaustralia.com",
|
||||||
|
"theaustralian.com.au",
|
||||||
|
"aap.com.au",
|
||||||
|
"news.com.au",
|
||||||
|
"skynews.com.au",
|
||||||
|
"skyweather.com.au",
|
||||||
|
"australiannewschannel.com.au",
|
||||||
|
"weeklytimesnow.com.au",
|
||||||
|
"dailytelegraph.com.au",
|
||||||
|
"heraldsun.com.au",
|
||||||
|
"geelongadvertiser.com.au",
|
||||||
|
"couriermail.com.au",
|
||||||
|
"thesundaymail.com.au",
|
||||||
|
"goldcoastbulletin.com.au",
|
||||||
|
"cairnspost.com.au",
|
||||||
|
"townsvillebulletin.com.au",
|
||||||
|
"adelaidenow.com.au",
|
||||||
|
"themercury.com.au",
|
||||||
|
"ntnews.com.au",
|
||||||
|
"postcourier.com.pg",
|
||||||
|
"nypost.com",
|
||||||
|
"pagesix.com",
|
||||||
|
"realtor.com",
|
||||||
|
"wsj.com",
|
||||||
|
"wsj.net",
|
||||||
|
"foxnews.com",
|
||||||
|
"fncstatic.com",
|
||||||
|
"foxnewsgo.com",
|
||||||
|
"fox.com",
|
||||||
|
"foxbusiness.com",
|
||||||
|
"foxsports.com",
|
||||||
|
"fssta.com",
|
||||||
|
"foxsports.com.au",
|
||||||
|
"dowjones.com",
|
||||||
|
"factiva.com",
|
||||||
|
"barrons.com",
|
||||||
|
"marketwatch.com",
|
||||||
|
"heatst.com",
|
||||||
|
"fnlondon.com",
|
||||||
|
"mansionglobal.com",
|
||||||
|
"spindices.com",
|
||||||
|
"spglobal.com",
|
||||||
|
"talksport.com",
|
||||||
|
"harpercollins.com",
|
||||||
|
"bestrecipes.com.au",
|
||||||
|
"hipages.com.au",
|
||||||
|
"homeimprovementpages.com.au",
|
||||||
|
"odds.com.au",
|
||||||
|
"onebigswitch.com.au",
|
||||||
|
"suddenly.com.au",
|
||||||
|
"supercoach.com.au",
|
||||||
|
"punters.com.au",
|
||||||
|
"kayosports.com.au",
|
||||||
|
"foxtel.com.au",
|
||||||
|
"newscorp.com",
|
||||||
|
"storyful.com",
|
||||||
|
"vogue.com.au",
|
||||||
|
"taste.com.au",
|
||||||
|
"kidspot.com.au",
|
||||||
|
"bodyandsoul.com.au",
|
||||||
|
"realcommercial.com.au",
|
||||||
|
"reastatic.net",
|
||||||
|
"realestate.com.au",
|
||||||
|
"whereilive.com.au",
|
||||||
|
"www.newsoftheworld.co.uk",
|
||||||
|
"newsoftheworld.co.uk"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "UK RW Think Tanks",
|
||||||
|
"warning": "UK RW Think Tank",
|
||||||
|
"words": [
|
||||||
|
"Adam Smith Institute",
|
||||||
|
"Bow Group",
|
||||||
|
"Centre for Policy Studies",
|
||||||
|
"Centre for Social Justice",
|
||||||
|
"Chatham House",
|
||||||
|
"Institute of Economic Affairs",
|
||||||
|
"Legatum Institute",
|
||||||
|
"Policy Exchange"
|
||||||
|
],
|
||||||
|
"domains": [
|
||||||
|
"adamsmith.org",
|
||||||
|
"bowgroup.org",
|
||||||
|
"cps.org.uk",
|
||||||
|
"centreforsocialjustice.org.uk",
|
||||||
|
"chathamhouse.org",
|
||||||
|
"iea.org.uk",
|
||||||
|
"https://li.com",
|
||||||
|
"policyexchange.org.uk"
|
||||||
|
]
|
||||||
|
}
|
||||||
227
daemon.py
227
daemon.py
|
|
@ -125,6 +125,8 @@ from media import replaceTwitter
|
||||||
from media import attachMedia
|
from media import attachMedia
|
||||||
from media import pathIsVideo
|
from media import pathIsVideo
|
||||||
from media import pathIsAudio
|
from media import pathIsAudio
|
||||||
|
from blocking import getCWlistVariable
|
||||||
|
from blocking import loadCWLists
|
||||||
from blocking import updateBlockedCache
|
from blocking import updateBlockedCache
|
||||||
from blocking import mutePost
|
from blocking import mutePost
|
||||||
from blocking import unmutePost
|
from blocking import unmutePost
|
||||||
|
|
@ -1229,7 +1231,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.maxRecentPosts)
|
self.server.maxRecentPosts,
|
||||||
|
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
|
||||||
|
|
@ -3007,7 +3011,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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)
|
||||||
|
|
@ -3065,7 +3071,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName, 'outbox',
|
self.server.themeName, 'outbox',
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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)
|
||||||
|
|
@ -3103,7 +3111,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName, 'bookmarks',
|
self.server.themeName, 'bookmarks',
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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)
|
||||||
|
|
@ -3207,7 +3217,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
accessKeys,
|
accessKeys,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
signingPrivateKeyPem)
|
signingPrivateKeyPem,
|
||||||
|
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)
|
||||||
|
|
@ -5684,9 +5696,24 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if isModerator(self.server.baseDir, nickname):
|
||||||
|
# set selected content warning lists
|
||||||
|
newListsEnabled = ''
|
||||||
|
for name, item in self.server.CWlists.items():
|
||||||
|
listVarName = getCWlistVariable(name)
|
||||||
|
if fields.get(listVarName):
|
||||||
|
if fields[listVarName] == 'on':
|
||||||
|
if newListsEnabled:
|
||||||
|
newListsEnabled += ', ' + name
|
||||||
|
else:
|
||||||
|
newListsEnabled += name
|
||||||
|
if newListsEnabled != self.server.listsEnabled:
|
||||||
|
self.server.listsEnabled = newListsEnabled
|
||||||
|
setConfigParam(self.server.baseDir,
|
||||||
|
"listsEnabled",
|
||||||
|
newListsEnabled)
|
||||||
|
|
||||||
# save blocked user agents
|
# save blocked user agents
|
||||||
# This is admin lebel and global to the instance
|
|
||||||
if path.startswith('/users/' + adminNickname + '/'):
|
|
||||||
userAgentsBlocked = []
|
userAgentsBlocked = []
|
||||||
if fields.get('userAgentsBlockedStr'):
|
if fields.get('userAgentsBlockedStr'):
|
||||||
userAgentsBlockedStr = \
|
userAgentsBlockedStr = \
|
||||||
|
|
@ -6727,7 +6754,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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)
|
||||||
|
|
@ -6854,9 +6883,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._redirect_headers(actorPathStr, cookie,
|
self._redirect_headers(actorPathStr, cookie,
|
||||||
callingDomain)
|
callingDomain)
|
||||||
return
|
return
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton1',
|
|
||||||
self.server.debug)
|
|
||||||
if not self.server.session:
|
if not self.server.session:
|
||||||
print('Starting new session during repeat button')
|
print('Starting new session during repeat button')
|
||||||
self.server.session = createSession(proxyType)
|
self.server.session = createSession(proxyType)
|
||||||
|
|
@ -6866,9 +6892,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._404()
|
self._404()
|
||||||
self.server.GETbusy = False
|
self.server.GETbusy = False
|
||||||
return
|
return
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton2',
|
|
||||||
self.server.debug)
|
|
||||||
self.server.actorRepeat = path.split('?actor=')[1]
|
self.server.actorRepeat = path.split('?actor=')[1]
|
||||||
announceToStr = \
|
announceToStr = \
|
||||||
localActorUrl(httpPrefix, self.postToNickname, domainFull) + \
|
localActorUrl(httpPrefix, self.postToNickname, domainFull) + \
|
||||||
|
|
@ -6891,9 +6914,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
debug,
|
debug,
|
||||||
self.server.projectVersion,
|
self.server.projectVersion,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton3',
|
|
||||||
self.server.debug)
|
|
||||||
announceFilename = None
|
announceFilename = None
|
||||||
if announceJson:
|
if announceJson:
|
||||||
# save the announce straight to the outbox
|
# save the announce straight to the outbox
|
||||||
|
|
@ -6905,10 +6925,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.postToNickname, domainFull,
|
self.postToNickname, domainFull,
|
||||||
announceJson, 'outbox')
|
announceJson, 'outbox')
|
||||||
|
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton4',
|
|
||||||
self.server.debug)
|
|
||||||
|
|
||||||
# clear the icon from the cache so that it gets updated
|
# clear the icon from the cache so that it gets updated
|
||||||
if self.server.iconsCache.get('repeat.png'):
|
if self.server.iconsCache.get('repeat.png'):
|
||||||
del self.server.iconsCache['repeat.png']
|
del self.server.iconsCache['repeat.png']
|
||||||
|
|
@ -6917,7 +6933,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutboxThread(announceJson)
|
self._postToOutboxThread(announceJson)
|
||||||
|
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
fitnessPerformance(GETstartTime, self.server.fitness,
|
||||||
'_GET', '_announceButton5',
|
'_GET', '_announceButton postToOutboxThread',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
|
||||||
# generate the html for the announce
|
# generate the html for the announce
|
||||||
|
|
@ -6927,9 +6943,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
cachedPostFilename = \
|
cachedPostFilename = \
|
||||||
getCachedPostFilename(baseDir, self.postToNickname,
|
getCachedPostFilename(baseDir, self.postToNickname,
|
||||||
domain, announceJson)
|
domain, announceJson)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton6',
|
|
||||||
self.server.debug)
|
|
||||||
if debug:
|
if debug:
|
||||||
print('Announced post json: ' + str(announceJson))
|
print('Announced post json: ' + str(announceJson))
|
||||||
print('Announced post nickname: ' +
|
print('Announced post nickname: ' +
|
||||||
|
|
@ -6940,9 +6953,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
followerApprovalActive(baseDir,
|
followerApprovalActive(baseDir,
|
||||||
self.postToNickname, domain)
|
self.postToNickname, domain)
|
||||||
showRepeats = not isDM(announceJson)
|
showRepeats = not isDM(announceJson)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_announceButton7',
|
|
||||||
self.server.debug)
|
|
||||||
individualPostAsHtml(self.server.signingPrivateKeyPem, False,
|
individualPostAsHtml(self.server.signingPrivateKeyPem, False,
|
||||||
self.server.recentPostsCache,
|
self.server.recentPostsCache,
|
||||||
self.server.maxRecentPosts,
|
self.server.maxRecentPosts,
|
||||||
|
|
@ -6968,10 +6978,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showRepeats,
|
showRepeats,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False,
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
self.server.CWlists,
|
||||||
'_GET', '_announceButton8',
|
self.server.listsEnabled)
|
||||||
self.server.debug)
|
|
||||||
|
|
||||||
self.server.GETbusy = False
|
self.server.GETbusy = False
|
||||||
actorAbsolute = self._getInstanceUrl(callingDomain) + actor
|
actorAbsolute = self._getInstanceUrl(callingDomain) + actor
|
||||||
|
|
@ -7348,9 +7357,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._redirect_headers(actorPathStr, cookie,
|
self._redirect_headers(actorPathStr, cookie,
|
||||||
callingDomain)
|
callingDomain)
|
||||||
return
|
return
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton1',
|
|
||||||
self.server.debug)
|
|
||||||
if not self.server.session:
|
if not self.server.session:
|
||||||
print('Starting new session during like')
|
print('Starting new session during like')
|
||||||
self.server.session = createSession(proxyType)
|
self.server.session = createSession(proxyType)
|
||||||
|
|
@ -7359,9 +7365,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._404()
|
self._404()
|
||||||
self.server.GETbusy = False
|
self.server.GETbusy = False
|
||||||
return
|
return
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton2',
|
|
||||||
self.server.debug)
|
|
||||||
likeActor = \
|
likeActor = \
|
||||||
localActorUrl(httpPrefix, self.postToNickname, domainFull)
|
localActorUrl(httpPrefix, self.postToNickname, domainFull)
|
||||||
actorLiked = path.split('?actor=')[1]
|
actorLiked = path.split('?actor=')[1]
|
||||||
|
|
@ -7372,9 +7375,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
origActor, origPostUrl, origFilename = \
|
origActor, origPostUrl, origFilename = \
|
||||||
getOriginalPostFromAnnounceUrl(likeUrl, baseDir,
|
getOriginalPostFromAnnounceUrl(likeUrl, baseDir,
|
||||||
self.postToNickname, domain)
|
self.postToNickname, domain)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton3',
|
|
||||||
self.server.debug)
|
|
||||||
likeUrl2 = likeUrl
|
likeUrl2 = likeUrl
|
||||||
likedPostFilename = origFilename
|
likedPostFilename = origFilename
|
||||||
if origActor and origPostUrl:
|
if origActor and origPostUrl:
|
||||||
|
|
@ -7394,7 +7394,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutbox(likeJson, self.server.projectVersion, None)
|
self._postToOutbox(likeJson, self.server.projectVersion, None)
|
||||||
|
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
fitnessPerformance(GETstartTime, self.server.fitness,
|
||||||
'_GET', '_likeButton4',
|
'_GET', '_likeButton postToOutbox',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
|
||||||
print('Locating liked post ' + likeUrl)
|
print('Locating liked post ' + likeUrl)
|
||||||
|
|
@ -7403,9 +7403,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
likedPostFilename = \
|
likedPostFilename = \
|
||||||
locatePost(baseDir, self.postToNickname, domain, likeUrl)
|
locatePost(baseDir, self.postToNickname, domain, likeUrl)
|
||||||
if likedPostFilename:
|
if likedPostFilename:
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton5',
|
|
||||||
self.server.debug)
|
|
||||||
recentPostsCache = self.server.recentPostsCache
|
recentPostsCache = self.server.recentPostsCache
|
||||||
likedPostJson = loadJson(likedPostFilename, 0, 1)
|
likedPostJson = loadJson(likedPostFilename, 0, 1)
|
||||||
if origFilename and origPostUrl:
|
if origFilename and origPostUrl:
|
||||||
|
|
@ -7417,9 +7414,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
likedPostFilename = origFilename
|
likedPostFilename = origFilename
|
||||||
if debug:
|
if debug:
|
||||||
print('Updating likes for ' + likedPostFilename)
|
print('Updating likes for ' + likedPostFilename)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton6',
|
|
||||||
self.server.debug)
|
|
||||||
updateLikesCollection(recentPostsCache,
|
updateLikesCollection(recentPostsCache,
|
||||||
baseDir, likedPostFilename, likeUrl,
|
baseDir, likedPostFilename, likeUrl,
|
||||||
likeActor, self.postToNickname, domain,
|
likeActor, self.postToNickname, domain,
|
||||||
|
|
@ -7428,9 +7422,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('Regenerating html post for changed likes collection')
|
print('Regenerating html post for changed likes collection')
|
||||||
# clear the icon from the cache so that it gets updated
|
# clear the icon from the cache so that it gets updated
|
||||||
if likedPostJson:
|
if likedPostJson:
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton6',
|
|
||||||
self.server.debug)
|
|
||||||
cachedPostFilename = \
|
cachedPostFilename = \
|
||||||
getCachedPostFilename(baseDir, self.postToNickname,
|
getCachedPostFilename(baseDir, self.postToNickname,
|
||||||
domain, likedPostJson)
|
domain, likedPostJson)
|
||||||
|
|
@ -7444,9 +7435,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
followerApprovalActive(baseDir,
|
followerApprovalActive(baseDir,
|
||||||
self.postToNickname, domain)
|
self.postToNickname, domain)
|
||||||
showRepeats = not isDM(likedPostJson)
|
showRepeats = not isDM(likedPostJson)
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
|
||||||
'_GET', '_likeButton7',
|
|
||||||
self.server.debug)
|
|
||||||
individualPostAsHtml(self.server.signingPrivateKeyPem, False,
|
individualPostAsHtml(self.server.signingPrivateKeyPem, False,
|
||||||
self.server.recentPostsCache,
|
self.server.recentPostsCache,
|
||||||
self.server.maxRecentPosts,
|
self.server.maxRecentPosts,
|
||||||
|
|
@ -7473,10 +7461,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showRepeats,
|
showRepeats,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False,
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
self.server.CWlists,
|
||||||
'_GET', '_likeButton8',
|
self.server.listsEnabled)
|
||||||
self.server.debug)
|
|
||||||
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
|
||||||
|
|
@ -7636,7 +7623,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showRepeats,
|
showRepeats,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False,
|
||||||
|
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
|
||||||
|
|
@ -7771,7 +7760,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showRepeats,
|
showRepeats,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False,
|
||||||
|
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)
|
||||||
|
|
@ -7905,7 +7896,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showRepeats,
|
showRepeats,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False,
|
||||||
|
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
|
||||||
|
|
@ -8007,7 +8000,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -8115,7 +8110,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
showPublicOnly, storeToCache,
|
showPublicOnly, storeToCache,
|
||||||
useCacheOnly)
|
useCacheOnly,
|
||||||
|
self.server.CWlists,
|
||||||
|
self.server.listsEnabled)
|
||||||
else:
|
else:
|
||||||
print('WARN: Muted post not found: ' + muteFilename)
|
print('WARN: Muted post not found: ' + muteFilename)
|
||||||
|
|
||||||
|
|
@ -8224,7 +8221,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
showPublicOnly, storeToCache,
|
showPublicOnly, storeToCache,
|
||||||
useCacheOnly)
|
useCacheOnly,
|
||||||
|
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
|
||||||
|
|
@ -8347,7 +8346,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -8446,7 +8447,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -8555,7 +8558,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
rolesList,
|
rolesList,
|
||||||
None, None)
|
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,
|
||||||
|
|
@ -8668,7 +8672,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
skills,
|
skills,
|
||||||
None, None)
|
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,
|
||||||
|
|
@ -8817,7 +8823,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9063,7 +9071,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
self.server.CWlists,
|
||||||
|
self.server.listsEnabled)
|
||||||
if GETstartTime:
|
if GETstartTime:
|
||||||
fitnessPerformance(GETstartTime,
|
fitnessPerformance(GETstartTime,
|
||||||
self.server.fitness,
|
self.server.fitness,
|
||||||
|
|
@ -9211,7 +9221,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9352,7 +9364,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9492,7 +9506,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9632,7 +9648,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9781,7 +9799,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -9928,7 +9948,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10034,7 +10056,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10118,7 +10142,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10239,7 +10265,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10377,7 +10405,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10506,7 +10536,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
self.server.signingPrivateKeyPem)
|
self.server.signingPrivateKeyPem,
|
||||||
|
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,
|
||||||
|
|
@ -10633,7 +10665,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
shares,
|
shares,
|
||||||
pageNumber, sharesPerPage)
|
pageNumber, sharesPerPage,
|
||||||
|
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,
|
||||||
|
|
@ -10757,7 +10791,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
following,
|
following,
|
||||||
pageNumber,
|
pageNumber,
|
||||||
followsPerPage).encode('utf-8')
|
followsPerPage,
|
||||||
|
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)
|
||||||
|
|
@ -10880,7 +10916,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
followers,
|
followers,
|
||||||
pageNumber,
|
pageNumber,
|
||||||
followsPerPage).encode('utf-8')
|
followsPerPage,
|
||||||
|
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)
|
||||||
|
|
@ -11019,7 +11057,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.systemLanguage,
|
self.server.systemLanguage,
|
||||||
self.server.maxLikeCount,
|
self.server.maxLikeCount,
|
||||||
self.server.sharedItemsFederatedDomains,
|
self.server.sharedItemsFederatedDomains,
|
||||||
None, None).encode('utf-8')
|
None, None, None,
|
||||||
|
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)
|
||||||
|
|
@ -11785,7 +11825,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
city,
|
city,
|
||||||
self.server.userAgentsBlocked,
|
self.server.userAgentsBlocked,
|
||||||
accessKeys,
|
accessKeys,
|
||||||
defaultReplyIntervalHours).encode('utf-8')
|
defaultReplyIntervalHours,
|
||||||
|
self.server.CWlists,
|
||||||
|
self.server.listsEnabled).encode('utf-8')
|
||||||
if msg:
|
if msg:
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
self._set_headers('text/html', msglen,
|
self._set_headers('text/html', msglen,
|
||||||
|
|
@ -16875,7 +16917,8 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
def runDaemon(defaultReplyIntervalHours: int,
|
def runDaemon(listsEnabled: str,
|
||||||
|
defaultReplyIntervalHours: int,
|
||||||
lowBandwidth: bool,
|
lowBandwidth: bool,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
|
|
@ -17228,6 +17271,13 @@ def runDaemon(defaultReplyIntervalHours: int,
|
||||||
if not os.path.isdir(baseDir + '/accounts/news@' + domain):
|
if not os.path.isdir(baseDir + '/accounts/news@' + domain):
|
||||||
print('Creating news inbox: news@' + domain)
|
print('Creating news inbox: news@' + domain)
|
||||||
createNewsInbox(baseDir, domain, port, httpPrefix)
|
createNewsInbox(baseDir, domain, port, httpPrefix)
|
||||||
|
setConfigParam(baseDir, "listsEnabled", "Murdoch press")
|
||||||
|
|
||||||
|
if listsEnabled:
|
||||||
|
httpd.listsEnabled = listsEnabled
|
||||||
|
else:
|
||||||
|
httpd.listsEnabled = getConfigParam(baseDir, "listsEnabled")
|
||||||
|
httpd.CWlists = loadCWLists(baseDir, True)
|
||||||
|
|
||||||
# set the avatar for the news account
|
# set the avatar for the news account
|
||||||
httpd.themeName = getConfigParam(baseDir, 'theme')
|
httpd.themeName = getConfigParam(baseDir, 'theme')
|
||||||
|
|
@ -17359,7 +17409,8 @@ def runDaemon(defaultReplyIntervalHours: int,
|
||||||
httpd.systemLanguage,
|
httpd.systemLanguage,
|
||||||
httpd.maxLikeCount,
|
httpd.maxLikeCount,
|
||||||
httpd.signingPrivateKeyPem,
|
httpd.signingPrivateKeyPem,
|
||||||
httpd.defaultReplyIntervalHours), daemon=True)
|
httpd.defaultReplyIntervalHours,
|
||||||
|
httpd.CWlists), daemon=True)
|
||||||
|
|
||||||
print('Creating scheduled post thread')
|
print('Creating scheduled post thread')
|
||||||
httpd.thrPostSchedule = \
|
httpd.thrPostSchedule = \
|
||||||
|
|
|
||||||
14
epicyon.py
14
epicyon.py
|
|
@ -112,6 +112,10 @@ def str2bool(v) -> bool:
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='ActivityPub Server')
|
parser = argparse.ArgumentParser(description='ActivityPub Server')
|
||||||
|
parser.add_argument('--listsEnabled', type=str,
|
||||||
|
default=None,
|
||||||
|
help='Names of content warning lists enabled. ' +
|
||||||
|
'See the cwlists directory')
|
||||||
parser.add_argument('--userAgentBlocks', type=str,
|
parser.add_argument('--userAgentBlocks', type=str,
|
||||||
default=None,
|
default=None,
|
||||||
help='List of blocked user agents, separated by commas')
|
help='List of blocked user agents, separated by commas')
|
||||||
|
|
@ -3011,6 +3015,13 @@ if userAgentsBlockedStr:
|
||||||
for agentBlockStr in agentBlocksList:
|
for agentBlockStr in agentBlocksList:
|
||||||
userAgentsBlocked.append(agentBlockStr.strip())
|
userAgentsBlocked.append(agentBlockStr.strip())
|
||||||
|
|
||||||
|
listsEnabled = ''
|
||||||
|
if args.listsEnabled:
|
||||||
|
listsEnabled = args.listsEnabled
|
||||||
|
setConfigParam(baseDir, 'listsEnabled', listsEnabled)
|
||||||
|
else:
|
||||||
|
listsEnabled = getConfigParam(baseDir, 'listsEnabled')
|
||||||
|
|
||||||
city = \
|
city = \
|
||||||
getConfigParam(baseDir, 'city')
|
getConfigParam(baseDir, 'city')
|
||||||
if city is not None:
|
if city is not None:
|
||||||
|
|
@ -3064,7 +3075,8 @@ if args.defaultCurrency:
|
||||||
print('Default currency set to ' + args.defaultCurrency)
|
print('Default currency set to ' + args.defaultCurrency)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
runDaemon(args.defaultReplyIntervalHours,
|
runDaemon(listsEnabled,
|
||||||
|
args.defaultReplyIntervalHours,
|
||||||
args.lowBandwidth, args.maxLikeCount,
|
args.lowBandwidth, args.maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
userAgentsBlocked,
|
userAgentsBlocked,
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ def htmlWatchPointsGraph(baseDir: str, fitness: {}, fitnessId: str,
|
||||||
htmlStr += \
|
htmlStr += \
|
||||||
'<tr style="height:' + str(heightPercent) + '%">\n' + \
|
'<tr style="height:' + str(heightPercent) + '%">\n' + \
|
||||||
' <th scope="row">' + name + '</th>\n' + \
|
' <th scope="row">' + name + '</th>\n' + \
|
||||||
' <td><span>' + str(timeMS) + 'mS</span></td>\n' + \
|
' <td><span>' + str(timeMS) + '</span></td>\n' + \
|
||||||
'</tr>\n'
|
'</tr>\n'
|
||||||
ctr += 1
|
ctr += 1
|
||||||
if ctr >= maxEntries:
|
if ctr >= maxEntries:
|
||||||
|
|
|
||||||
60
inbox.py
60
inbox.py
|
|
@ -274,7 +274,9 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> None:
|
signingPrivateKeyPem: str,
|
||||||
|
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
|
||||||
"""
|
"""
|
||||||
|
|
@ -298,7 +300,8 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
peertubeInstances, allowLocalNetworkAccess,
|
peertubeInstances, allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage, maxLikeCount,
|
themeName, systemLanguage, maxLikeCount,
|
||||||
notDM, True, True, False, True, False)
|
notDM, True, True, False, True, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def validInbox(baseDir: str, nickname: str, domain: str) -> bool:
|
def validInbox(baseDir: str, nickname: str, domain: str) -> bool:
|
||||||
|
|
@ -980,7 +983,8 @@ def _receiveLike(recentPostsCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int) -> 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':
|
||||||
|
|
@ -1082,7 +1086,8 @@ def _receiveLike(recentPostsCache: {},
|
||||||
maxLikeCount, notDM,
|
maxLikeCount, notDM,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False, CWlists,
|
||||||
|
listsEnabled)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1100,7 +1105,8 @@ def _receiveUndoLike(recentPostsCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int) -> 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':
|
||||||
|
|
@ -1191,7 +1197,8 @@ def _receiveUndoLike(recentPostsCache: {},
|
||||||
maxLikeCount, notDM,
|
maxLikeCount, notDM,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False, CWlists,
|
||||||
|
listsEnabled)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1208,7 +1215,8 @@ def _receiveBookmark(recentPostsCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int) -> 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'):
|
||||||
|
|
@ -1299,7 +1307,8 @@ def _receiveBookmark(recentPostsCache: {},
|
||||||
maxLikeCount, notDM,
|
maxLikeCount, notDM,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False, CWlists,
|
||||||
|
listsEnabled)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1316,7 +1325,8 @@ def _receiveUndoBookmark(recentPostsCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int) -> 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'):
|
||||||
|
|
@ -1408,7 +1418,7 @@ def _receiveUndoBookmark(recentPostsCache: {},
|
||||||
maxLikeCount, notDM,
|
maxLikeCount, notDM,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
False, True, False, CWlists, listsEnabled)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1502,7 +1512,8 @@ def _receiveAnnounce(recentPostsCache: {},
|
||||||
maxRecentPosts: int,
|
maxRecentPosts: int,
|
||||||
allowDeletion: bool,
|
allowDeletion: bool,
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
maxLikeCount: int) -> 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':
|
||||||
|
|
@ -1614,7 +1625,8 @@ def _receiveAnnounce(recentPostsCache: {},
|
||||||
maxLikeCount, notDM,
|
maxLikeCount, notDM,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, False)
|
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))
|
||||||
|
|
@ -2551,7 +2563,8 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str,
|
signingPrivateKeyPem: str,
|
||||||
defaultReplyIntervalHours: int) -> bool:
|
defaultReplyIntervalHours: int,
|
||||||
|
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
|
||||||
|
|
@ -2581,7 +2594,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount):
|
maxLikeCount, CWlists, listsEnabled):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Like accepted from ' + actor)
|
print('DEBUG: Like accepted from ' + actor)
|
||||||
return False
|
return False
|
||||||
|
|
@ -2603,7 +2616,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount):
|
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
|
||||||
|
|
@ -2625,7 +2638,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount):
|
maxLikeCount, CWlists, listsEnabled):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Bookmark accepted from ' + actor)
|
print('DEBUG: Bookmark accepted from ' + actor)
|
||||||
return False
|
return False
|
||||||
|
|
@ -2647,7 +2660,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount):
|
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
|
||||||
|
|
@ -2673,7 +2686,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
maxRecentPosts,
|
maxRecentPosts,
|
||||||
allowDeletion,
|
allowDeletion,
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
maxLikeCount):
|
maxLikeCount, CWlists, listsEnabled):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Announce accepted from ' + actor)
|
print('DEBUG: Announce accepted from ' + actor)
|
||||||
|
|
||||||
|
|
@ -2954,7 +2967,8 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
signingPrivateKeyPem)
|
signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
if debug:
|
if debug:
|
||||||
timeDiff = \
|
timeDiff = \
|
||||||
str(int((time.time() - htmlCacheStartTime) *
|
str(int((time.time() - htmlCacheStartTime) *
|
||||||
|
|
@ -3239,7 +3253,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
verifyAllSignatures: bool,
|
verifyAllSignatures: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int, signingPrivateKeyPem: str,
|
maxLikeCount: int, signingPrivateKeyPem: str,
|
||||||
defaultReplyIntervalHours: int) -> None:
|
defaultReplyIntervalHours: int,
|
||||||
|
CWlists: {}) -> None:
|
||||||
"""Processes received items and moves them to the appropriate
|
"""Processes received items and moves them to the appropriate
|
||||||
directories
|
directories
|
||||||
"""
|
"""
|
||||||
|
|
@ -3626,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 = \
|
||||||
|
|
@ -3656,7 +3673,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
signingPrivateKeyPem,
|
signingPrivateKeyPem,
|
||||||
defaultReplyIntervalHours)
|
defaultReplyIntervalHours,
|
||||||
|
CWlists, listsEnabled)
|
||||||
if debug:
|
if debug:
|
||||||
pprint(queueJson['post'])
|
pprint(queueJson['post'])
|
||||||
print('Queue: Queue post accepted')
|
print('Queue: Queue post accepted')
|
||||||
|
|
|
||||||
|
|
@ -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) -> 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
|
||||||
|
|
@ -467,7 +468,8 @@ def postMessageToOutbox(session, translate: {},
|
||||||
boxNameIndex != 'dm',
|
boxNameIndex != 'dm',
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, useCacheOnly)
|
False, True, useCacheOnly,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
if outboxAnnounce(recentPostsCache,
|
if outboxAnnounce(recentPostsCache,
|
||||||
baseDir, messageJson, debug):
|
baseDir, messageJson, debug):
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,9 @@ def _updatePostSchedule(baseDir: str, handle: str, httpd,
|
||||||
httpd.peertubeInstances,
|
httpd.peertubeInstances,
|
||||||
httpd.themeName,
|
httpd.themeName,
|
||||||
httpd.maxLikeCount,
|
httpd.maxLikeCount,
|
||||||
httpd.maxRecentPosts):
|
httpd.maxRecentPosts,
|
||||||
|
httpd.CWlists,
|
||||||
|
httpd.listsEnabled):
|
||||||
indexLines.remove(line)
|
indexLines.remove(line)
|
||||||
try:
|
try:
|
||||||
os.remove(postFilename)
|
os.remove(postFilename)
|
||||||
|
|
|
||||||
55
tests.py
55
tests.py
|
|
@ -164,6 +164,8 @@ from shares import updateSharedItemFederationToken
|
||||||
from shares import mergeSharedItemTokens
|
from shares import mergeSharedItemTokens
|
||||||
from shares import sendShareViaServer
|
from shares import sendShareViaServer
|
||||||
from shares import getSharedItemsCatalogViaServer
|
from shares import getSharedItemsCatalogViaServer
|
||||||
|
from blocking import loadCWLists
|
||||||
|
from blocking import addCWfromLists
|
||||||
|
|
||||||
testServerGroupRunning = False
|
testServerGroupRunning = False
|
||||||
testServerAliceRunning = False
|
testServerAliceRunning = False
|
||||||
|
|
@ -815,8 +817,9 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
userAgentsBlocked = []
|
userAgentsBlocked = []
|
||||||
maxLikeCount = 10
|
maxLikeCount = 10
|
||||||
defaultReplyIntervalHours = 9999999999
|
defaultReplyIntervalHours = 9999999999
|
||||||
|
listsEnabled = ''
|
||||||
print('Server running: Alice')
|
print('Server running: Alice')
|
||||||
runDaemon(defaultReplyIntervalHours,
|
runDaemon(listsEnabled, defaultReplyIntervalHours,
|
||||||
lowBandwidth, maxLikeCount,
|
lowBandwidth, maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
userAgentsBlocked,
|
userAgentsBlocked,
|
||||||
|
|
@ -953,8 +956,9 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
userAgentsBlocked = []
|
userAgentsBlocked = []
|
||||||
maxLikeCount = 10
|
maxLikeCount = 10
|
||||||
defaultReplyIntervalHours = 9999999999
|
defaultReplyIntervalHours = 9999999999
|
||||||
|
listsEnabled = ''
|
||||||
print('Server running: Bob')
|
print('Server running: Bob')
|
||||||
runDaemon(defaultReplyIntervalHours,
|
runDaemon(listsEnabled, defaultReplyIntervalHours,
|
||||||
lowBandwidth, maxLikeCount,
|
lowBandwidth, maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
userAgentsBlocked,
|
userAgentsBlocked,
|
||||||
|
|
@ -1020,8 +1024,9 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
maxLikeCount = 10
|
maxLikeCount = 10
|
||||||
lowBandwidth = True
|
lowBandwidth = True
|
||||||
defaultReplyIntervalHours = 9999999999
|
defaultReplyIntervalHours = 9999999999
|
||||||
|
listsEnabled = ''
|
||||||
print('Server running: Eve')
|
print('Server running: Eve')
|
||||||
runDaemon(defaultReplyIntervalHours,
|
runDaemon(listsEnabled, defaultReplyIntervalHours,
|
||||||
lowBandwidth, maxLikeCount,
|
lowBandwidth, maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
userAgentsBlocked,
|
userAgentsBlocked,
|
||||||
|
|
@ -1089,8 +1094,9 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
maxLikeCount = 10
|
maxLikeCount = 10
|
||||||
lowBandwidth = True
|
lowBandwidth = True
|
||||||
defaultReplyIntervalHours = 9999999999
|
defaultReplyIntervalHours = 9999999999
|
||||||
|
listsEnabled = ''
|
||||||
print('Server running: Group')
|
print('Server running: Group')
|
||||||
runDaemon(defaultReplyIntervalHours,
|
runDaemon(listsEnabled, defaultReplyIntervalHours,
|
||||||
lowBandwidth, maxLikeCount,
|
lowBandwidth, maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains,
|
||||||
userAgentsBlocked,
|
userAgentsBlocked,
|
||||||
|
|
@ -5764,6 +5770,46 @@ def _testWordsSimilarity() -> None:
|
||||||
assert similarity > 80
|
assert similarity > 80
|
||||||
|
|
||||||
|
|
||||||
|
def _testAddCWfromLists(baseDir: str) -> None:
|
||||||
|
print('testAddCWfromLists')
|
||||||
|
translate = {}
|
||||||
|
CWlists = loadCWLists(baseDir, True)
|
||||||
|
assert CWlists
|
||||||
|
|
||||||
|
postJsonObject = {
|
||||||
|
"object": {
|
||||||
|
"sensitive": False,
|
||||||
|
"summary": None,
|
||||||
|
"content": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
|
||||||
|
assert postJsonObject['object']['sensitive'] is False
|
||||||
|
assert postJsonObject['object']['summary'] is None
|
||||||
|
|
||||||
|
postJsonObject = {
|
||||||
|
"object": {
|
||||||
|
"sensitive": False,
|
||||||
|
"summary": None,
|
||||||
|
"content": "Blah blah news.co.uk blah blah"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
|
||||||
|
assert postJsonObject['object']['sensitive'] is True
|
||||||
|
assert postJsonObject['object']['summary'] == "Murdoch Press"
|
||||||
|
|
||||||
|
postJsonObject = {
|
||||||
|
"object": {
|
||||||
|
"sensitive": True,
|
||||||
|
"summary": "Existing CW",
|
||||||
|
"content": "Blah blah news.co.uk blah blah"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addCWfromLists(postJsonObject, CWlists, translate, 'Murdoch press')
|
||||||
|
assert postJsonObject['object']['sensitive'] is True
|
||||||
|
assert postJsonObject['object']['summary'] == "Murdoch Press / Existing CW"
|
||||||
|
|
||||||
|
|
||||||
def runAllTests():
|
def runAllTests():
|
||||||
baseDir = os.getcwd()
|
baseDir = os.getcwd()
|
||||||
print('Running tests...')
|
print('Running tests...')
|
||||||
|
|
@ -5771,6 +5817,7 @@ def runAllTests():
|
||||||
_translateOntology(baseDir)
|
_translateOntology(baseDir)
|
||||||
_testGetPriceFromString()
|
_testGetPriceFromString()
|
||||||
_testFunctions()
|
_testFunctions()
|
||||||
|
_testAddCWfromLists(baseDir)
|
||||||
_testWordsSimilarity()
|
_testWordsSimilarity()
|
||||||
_testSecondsBetweenPublished()
|
_testSecondsBetweenPublished()
|
||||||
_testSignAndVerify()
|
_testSignAndVerify()
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "أعضاء",
|
"Members": "أعضاء",
|
||||||
"Join": "انضم",
|
"Join": "انضم",
|
||||||
"Leave": "يترك",
|
"Leave": "يترك",
|
||||||
"System Monitor": "مراقب النظام"
|
"System Monitor": "مراقب النظام",
|
||||||
|
"Add content warnings for the following sites": "أضف تحذيرات المحتوى للمواقع التالية"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Membres",
|
"Members": "Membres",
|
||||||
"Join": "Uneix-te",
|
"Join": "Uneix-te",
|
||||||
"Leave": "Marxa",
|
"Leave": "Marxa",
|
||||||
"System Monitor": "Monitor del sistema"
|
"System Monitor": "Monitor del sistema",
|
||||||
|
"Add content warnings for the following sites": "Afegiu advertiments de contingut per als llocs següents"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Aelodau",
|
"Members": "Aelodau",
|
||||||
"Join": "Ymunwch",
|
"Join": "Ymunwch",
|
||||||
"Leave": "Gadewch",
|
"Leave": "Gadewch",
|
||||||
"System Monitor": "Monitor System"
|
"System Monitor": "Monitor System",
|
||||||
|
"Add content warnings for the following sites": "Ychwanegwch rybuddion cynnwys ar gyfer y gwefannau canlynol"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Mitglieder",
|
"Members": "Mitglieder",
|
||||||
"Join": "Verbinden",
|
"Join": "Verbinden",
|
||||||
"Leave": "Verlassen",
|
"Leave": "Verlassen",
|
||||||
"System Monitor": "Systemmonitor"
|
"System Monitor": "Systemmonitor",
|
||||||
|
"Add content warnings for the following sites": "Inhaltswarnungen für die folgenden Websites hinzufügen"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Members",
|
"Members": "Members",
|
||||||
"Join": "Join",
|
"Join": "Join",
|
||||||
"Leave": "Leave",
|
"Leave": "Leave",
|
||||||
"System Monitor": "System Monitor"
|
"System Monitor": "System Monitor",
|
||||||
|
"Add content warnings for the following sites": "Add content warnings for the following sites"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Miembros",
|
"Members": "Miembros",
|
||||||
"Join": "Entrar",
|
"Join": "Entrar",
|
||||||
"Leave": "Dejar",
|
"Leave": "Dejar",
|
||||||
"System Monitor": "Monitor del sistema"
|
"System Monitor": "Monitor del sistema",
|
||||||
|
"Add content warnings for the following sites": "Agregue advertencias de contenido para los siguientes sitios"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Membres",
|
"Members": "Membres",
|
||||||
"Join": "Rejoindre",
|
"Join": "Rejoindre",
|
||||||
"Leave": "Laisser",
|
"Leave": "Laisser",
|
||||||
"System Monitor": "Moniteur système"
|
"System Monitor": "Moniteur système",
|
||||||
|
"Add content warnings for the following sites": "Ajouter des avertissements de contenu pour les sites suivants"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Baill",
|
"Members": "Baill",
|
||||||
"Join": "Bí páirteach",
|
"Join": "Bí páirteach",
|
||||||
"Leave": "Fág",
|
"Leave": "Fág",
|
||||||
"System Monitor": "Monatóir Córais"
|
"System Monitor": "Monatóir Córais",
|
||||||
|
"Add content warnings for the following sites": "Cuir rabhaidh ábhair leis na suíomhanna seo a leanas"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "सदस्यों",
|
"Members": "सदस्यों",
|
||||||
"Join": "शामिल हों",
|
"Join": "शामिल हों",
|
||||||
"Leave": "छोड़ना",
|
"Leave": "छोड़ना",
|
||||||
"System Monitor": "सिस्टम मॉनिटर"
|
"System Monitor": "सिस्टम मॉनिटर",
|
||||||
|
"Add content warnings for the following sites": "निम्नलिखित साइटों के लिए सामग्री चेतावनियाँ जोड़ें"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Membri",
|
"Members": "Membri",
|
||||||
"Join": "Aderire",
|
"Join": "Aderire",
|
||||||
"Leave": "Lasciare",
|
"Leave": "Lasciare",
|
||||||
"System Monitor": "Monitor di sistema"
|
"System Monitor": "Monitor di sistema",
|
||||||
|
"Add content warnings for the following sites": "Aggiungi avvisi sui contenuti per i seguenti siti"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "メンバー",
|
"Members": "メンバー",
|
||||||
"Join": "加入",
|
"Join": "加入",
|
||||||
"Leave": "離れる",
|
"Leave": "離れる",
|
||||||
"System Monitor": "システムモニター"
|
"System Monitor": "システムモニター",
|
||||||
|
"Add content warnings for the following sites": "次のサイトのコンテンツ警告を追加します"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Endam",
|
"Members": "Endam",
|
||||||
"Join": "Bihevgirêdan",
|
"Join": "Bihevgirêdan",
|
||||||
"Leave": "Terikandin",
|
"Leave": "Terikandin",
|
||||||
"System Monitor": "System Monitor"
|
"System Monitor": "System Monitor",
|
||||||
|
"Add content warnings for the following sites": "Ji bo malperên jêrîn hişyariyên naverokê zêde bikin"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -484,5 +484,6 @@
|
||||||
"Members": "Members",
|
"Members": "Members",
|
||||||
"Join": "Join",
|
"Join": "Join",
|
||||||
"Leave": "Leave",
|
"Leave": "Leave",
|
||||||
"System Monitor": "System Monitor"
|
"System Monitor": "System Monitor",
|
||||||
|
"Add content warnings for the following sites": "Add content warnings for the following sites"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Membros",
|
"Members": "Membros",
|
||||||
"Join": "Juntar",
|
"Join": "Juntar",
|
||||||
"Leave": "Sair",
|
"Leave": "Sair",
|
||||||
"System Monitor": "Monitor de Sistema"
|
"System Monitor": "Monitor de Sistema",
|
||||||
|
"Add content warnings for the following sites": "Adicione avisos de conteúdo para os seguintes sites"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Члены",
|
"Members": "Члены",
|
||||||
"Join": "Присоединиться",
|
"Join": "Присоединиться",
|
||||||
"Leave": "Оставлять",
|
"Leave": "Оставлять",
|
||||||
"System Monitor": "Системный монитор"
|
"System Monitor": "Системный монитор",
|
||||||
|
"Add content warnings for the following sites": "Добавить предупреждения о содержании для следующих сайтов"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "Wanachama",
|
"Members": "Wanachama",
|
||||||
"Join": "Jiunge",
|
"Join": "Jiunge",
|
||||||
"Leave": "Ondoka",
|
"Leave": "Ondoka",
|
||||||
"System Monitor": "Ufuatiliaji wa Mfumo"
|
"System Monitor": "Ufuatiliaji wa Mfumo",
|
||||||
|
"Add content warnings for the following sites": "Ongeza maonyo ya yaliyomo kwa wavuti zifuatazo"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,5 +488,6 @@
|
||||||
"Members": "会员",
|
"Members": "会员",
|
||||||
"Join": "加入",
|
"Join": "加入",
|
||||||
"Leave": "离开",
|
"Leave": "离开",
|
||||||
"System Monitor": "系统监视器"
|
"System Monitor": "系统监视器",
|
||||||
|
"Add content warnings for the following sites": "为以下网站添加内容警告"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ def htmlConfirmDelete(cssCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int, signingPrivateKeyPem: str) -> str:
|
maxLikeCount: int, signingPrivateKeyPem: 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:
|
||||||
|
|
@ -79,7 +80,8 @@ def htmlConfirmDelete(cssCache: {},
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
peertubeInstances, allowLocalNetworkAccess,
|
peertubeInstances, allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage, maxLikeCount,
|
themeName, systemLanguage, maxLikeCount,
|
||||||
False, False, False, False, False, False)
|
False, False, False, False, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
deletePostStr += '<center>'
|
deletePostStr += '<center>'
|
||||||
deletePostStr += \
|
deletePostStr += \
|
||||||
' <p class="followText">' + \
|
' <p class="followText">' + \
|
||||||
|
|
|
||||||
|
|
@ -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) -> 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
|
||||||
|
|
@ -81,7 +82,8 @@ def _htmlFrontScreenPosts(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
False, False, False,
|
False, False, False,
|
||||||
True, False, False)
|
True, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
if postStr:
|
if postStr:
|
||||||
profileStr += postStr + separatorStr
|
profileStr += postStr + separatorStr
|
||||||
ctr += 1
|
ctr += 1
|
||||||
|
|
@ -109,9 +111,10 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
|
||||||
accessKeys: {},
|
accessKeys: {},
|
||||||
systemLanguage: str, maxLikeCount: int,
|
systemLanguage: str, maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
extraJson: {} = None,
|
extraJson: {},
|
||||||
pageNumber: int = None,
|
pageNumber: int,
|
||||||
maxItemsPerPage: int = None) -> str:
|
maxItemsPerPage: int,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the news instance front screen
|
"""Show the news instance front screen
|
||||||
"""
|
"""
|
||||||
nickname = profileJson['preferredUsername']
|
nickname = profileJson['preferredUsername']
|
||||||
|
|
@ -182,7 +185,8 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
theme, systemLanguage,
|
theme, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
signingPrivateKeyPem) + licenseStr
|
signingPrivateKeyPem,
|
||||||
|
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'
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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
|
||||||
"""
|
"""
|
||||||
|
|
@ -72,7 +73,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
|
||||||
peertubeInstances, allowLocalNetworkAccess,
|
peertubeInstances, allowLocalNetworkAccess,
|
||||||
textModeBanner, accessKeys, systemLanguage,
|
textModeBanner, accessKeys, systemLanguage,
|
||||||
maxLikeCount, sharedItemsFederatedDomains,
|
maxLikeCount, sharedItemsFederatedDomains,
|
||||||
signingPrivateKeyPem)
|
signingPrivateKeyPem, CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlAccountInfo(cssCache: {}, translate: {},
|
def htmlAccountInfo(cssCache: {}, translate: {},
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ from webfinger import webfingerHandle
|
||||||
from speaker import updateSpeaker
|
from speaker import updateSpeaker
|
||||||
from languages import autoTranslatePost
|
from languages import autoTranslatePost
|
||||||
from blocking import isBlocked
|
from blocking import isBlocked
|
||||||
|
from blocking import addCWfromLists
|
||||||
|
|
||||||
|
|
||||||
def _logPostTiming(enableTimingLog: bool, postStartTime, debugId: str) -> None:
|
def _logPostTiming(enableTimingLog: bool, postStartTime, debugId: str) -> None:
|
||||||
|
|
@ -1205,7 +1206,9 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
|
||||||
manuallyApprovesFollowers: bool,
|
manuallyApprovesFollowers: bool,
|
||||||
showPublicOnly: bool,
|
showPublicOnly: bool,
|
||||||
storeToCache: bool,
|
storeToCache: bool,
|
||||||
useCacheOnly: bool) -> str:
|
useCacheOnly: bool,
|
||||||
|
CWlists: {},
|
||||||
|
listsEnabled: str) -> str:
|
||||||
""" Shows a single post as html
|
""" Shows a single post as html
|
||||||
"""
|
"""
|
||||||
if not postJsonObject:
|
if not postJsonObject:
|
||||||
|
|
@ -1651,6 +1654,9 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
|
||||||
if newFooterStr:
|
if newFooterStr:
|
||||||
footerStr = newFooterStr
|
footerStr = newFooterStr
|
||||||
|
|
||||||
|
# add any content warning from the cwlists directory
|
||||||
|
addCWfromLists(postJsonObject, CWlists, translate, listsEnabled)
|
||||||
|
|
||||||
postIsSensitive = False
|
postIsSensitive = False
|
||||||
if postJsonObject['object'].get('sensitive'):
|
if postJsonObject['object'].get('sensitive'):
|
||||||
# sensitive posts should have a summary
|
# sensitive posts should have a summary
|
||||||
|
|
@ -1825,7 +1831,8 @@ def htmlIndividualPost(cssCache: {},
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int, signingPrivateKeyPem: str) -> str:
|
maxLikeCount: int, signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show an individual post as html
|
"""Show an individual post as html
|
||||||
"""
|
"""
|
||||||
postStr = ''
|
postStr = ''
|
||||||
|
|
@ -1878,7 +1885,8 @@ def htmlIndividualPost(cssCache: {},
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess, themeName,
|
allowLocalNetworkAccess, themeName,
|
||||||
systemLanguage, maxLikeCount,
|
systemLanguage, maxLikeCount,
|
||||||
False, authorized, False, False, False, False)
|
False, authorized, False, False, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
messageId = removeIdEnding(postJsonObject['id'])
|
messageId = removeIdEnding(postJsonObject['id'])
|
||||||
|
|
||||||
# show the previous posts
|
# show the previous posts
|
||||||
|
|
@ -1910,7 +1918,8 @@ def htmlIndividualPost(cssCache: {},
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
False, authorized,
|
False, authorized,
|
||||||
False, False, False, False) + postStr
|
False, False, False, False,
|
||||||
|
CWlists, listsEnabled) + postStr
|
||||||
|
|
||||||
# show the following posts
|
# show the following posts
|
||||||
postFilename = locatePost(baseDir, nickname, domain, messageId)
|
postFilename = locatePost(baseDir, nickname, domain, messageId)
|
||||||
|
|
@ -1944,7 +1953,8 @@ def htmlIndividualPost(cssCache: {},
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
False, authorized,
|
False, authorized,
|
||||||
False, False, False, False)
|
False, False, False, False,
|
||||||
|
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'
|
||||||
|
|
@ -1968,7 +1978,8 @@ def htmlPostReplies(cssCache: {},
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> 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 = ''
|
||||||
|
|
@ -1991,7 +2002,8 @@ def htmlPostReplies(cssCache: {},
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
False, False, False, False, False, False)
|
False, False, False, False, False, False,
|
||||||
|
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'):
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ from person import personBoxJson
|
||||||
from person import getActorJson
|
from person import getActorJson
|
||||||
from person import getPersonAvatarUrl
|
from person import getPersonAvatarUrl
|
||||||
from webfinger import webfingerHandle
|
from webfinger import webfingerHandle
|
||||||
|
from posts import isModerator
|
||||||
from posts import parseUserFeed
|
from posts import parseUserFeed
|
||||||
from posts import getPersonBox
|
from posts import getPersonBox
|
||||||
from posts import isCreateInsideAnnounce
|
from posts import isCreateInsideAnnounce
|
||||||
|
|
@ -69,6 +70,7 @@ from webapp_utils import endEditSection
|
||||||
from blog import getBlogAddress
|
from blog import getBlogAddress
|
||||||
from webapp_post import individualPostAsHtml
|
from webapp_post import individualPostAsHtml
|
||||||
from webapp_timeline import htmlIndividualShare
|
from webapp_timeline import htmlIndividualShare
|
||||||
|
from blocking import getCWlistVariable
|
||||||
|
|
||||||
|
|
||||||
def htmlProfileAfterSearch(cssCache: {},
|
def htmlProfileAfterSearch(cssCache: {},
|
||||||
|
|
@ -89,7 +91,8 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
accessKeys: {},
|
accessKeys: {},
|
||||||
systemLanguage: str,
|
systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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
|
||||||
|
|
@ -306,7 +309,8 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
peertubeInstances,
|
peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
themeName, systemLanguage, maxLikeCount,
|
themeName, systemLanguage, maxLikeCount,
|
||||||
False, False, False, False, False, False)
|
False, False, False, False, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
i += 1
|
i += 1
|
||||||
if i >= 8:
|
if i >= 8:
|
||||||
break
|
break
|
||||||
|
|
@ -516,8 +520,9 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
debug: bool, accessKeys: {}, city: str,
|
debug: bool, accessKeys: {}, city: str,
|
||||||
systemLanguage: str, maxLikeCount: int,
|
systemLanguage: str, maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
extraJson: {} = None, pageNumber: int = None,
|
extraJson: {}, pageNumber: int,
|
||||||
maxItemsPerPage: int = None) -> str:
|
maxItemsPerPage: int,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the profile page as html
|
"""Show the profile page as html
|
||||||
"""
|
"""
|
||||||
nickname = profileJson['preferredUsername']
|
nickname = profileJson['preferredUsername']
|
||||||
|
|
@ -539,8 +544,9 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
newswire, theme, extraJson,
|
newswire, theme, extraJson,
|
||||||
allowLocalNetworkAccess, accessKeys,
|
allowLocalNetworkAccess, accessKeys,
|
||||||
systemLanguage, maxLikeCount,
|
systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains,
|
sharedItemsFederatedDomains, None,
|
||||||
pageNumber, maxItemsPerPage)
|
pageNumber, maxItemsPerPage, CWlists,
|
||||||
|
listsEnabled)
|
||||||
|
|
||||||
domain, port = getDomainFromActor(profileJson['id'])
|
domain, port = getDomainFromActor(profileJson['id'])
|
||||||
if not domain:
|
if not domain:
|
||||||
|
|
@ -897,7 +903,8 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
theme, systemLanguage,
|
theme, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
signingPrivateKeyPem) + licenseStr
|
signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled) + licenseStr
|
||||||
if not isGroup:
|
if not isGroup:
|
||||||
if selected == 'following':
|
if selected == 'following':
|
||||||
profileStr += \
|
profileStr += \
|
||||||
|
|
@ -963,7 +970,8 @@ def _htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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
|
||||||
"""
|
"""
|
||||||
|
|
@ -1008,7 +1016,8 @@ def _htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
themeName, systemLanguage,
|
themeName, systemLanguage,
|
||||||
maxLikeCount,
|
maxLikeCount,
|
||||||
False, False, False,
|
False, False, False,
|
||||||
True, False, False)
|
True, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
if postStr:
|
if postStr:
|
||||||
profileStr += postStr + separatorStr
|
profileStr += postStr + separatorStr
|
||||||
ctr += 1
|
ctr += 1
|
||||||
|
|
@ -1512,7 +1521,8 @@ def _htmlEditProfileSharedItems(baseDir: str, nickname: str, domain: str,
|
||||||
|
|
||||||
def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
userAgentsBlocked: str, translate: {},
|
userAgentsBlocked: str, translate: {},
|
||||||
replyIntervalHours: int) -> str:
|
replyIntervalHours: int,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Filtering and blocking section of edit profile screen
|
"""Filtering and blocking section of edit profile screen
|
||||||
"""
|
"""
|
||||||
filterStr = ''
|
filterStr = ''
|
||||||
|
|
@ -1658,6 +1668,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
'style="height:200px" spellcheck="false">' + \
|
'style="height:200px" spellcheck="false">' + \
|
||||||
allowedInstancesStr + '</textarea>\n'
|
allowedInstancesStr + '</textarea>\n'
|
||||||
|
|
||||||
|
if isModerator(baseDir, nickname):
|
||||||
userAgentsBlockedStr = ''
|
userAgentsBlockedStr = ''
|
||||||
for ua in userAgentsBlocked:
|
for ua in userAgentsBlocked:
|
||||||
if userAgentsBlockedStr:
|
if userAgentsBlockedStr:
|
||||||
|
|
@ -1668,6 +1679,22 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
'userAgentsBlockedStr', userAgentsBlockedStr,
|
'userAgentsBlockedStr', userAgentsBlockedStr,
|
||||||
200, '', False)
|
200, '', False)
|
||||||
|
|
||||||
|
CWlistsStr = ''
|
||||||
|
for name, item in CWlists.items():
|
||||||
|
variableName = getCWlistVariable(name)
|
||||||
|
listIsEnabled = False
|
||||||
|
if listsEnabled:
|
||||||
|
if name in listsEnabled:
|
||||||
|
listIsEnabled = True
|
||||||
|
if translate.get(name):
|
||||||
|
name = translate[name]
|
||||||
|
CWlistsStr += editCheckBox(name, variableName, listIsEnabled)
|
||||||
|
if CWlistsStr:
|
||||||
|
idx = 'Add content warnings for the following sites'
|
||||||
|
editProfileForm += \
|
||||||
|
'<label class="labels">' + translate[idx] + ':</label>\n' + \
|
||||||
|
'<br>' + CWlistsStr
|
||||||
|
|
||||||
editProfileForm += endEditSection()
|
editProfileForm += endEditSection()
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
||||||
|
|
@ -1950,7 +1977,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
textModeBanner: str, city: str,
|
textModeBanner: str, city: str,
|
||||||
userAgentsBlocked: str,
|
userAgentsBlocked: str,
|
||||||
accessKeys: {},
|
accessKeys: {},
|
||||||
defaultReplyIntervalHours: int) -> str:
|
defaultReplyIntervalHours: int,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Shows the edit profile screen
|
"""Shows the edit profile screen
|
||||||
"""
|
"""
|
||||||
path = path.replace('/inbox', '').replace('/outbox', '')
|
path = path.replace('/inbox', '').replace('/outbox', '')
|
||||||
|
|
@ -2146,7 +2174,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
_htmlEditProfileFiltering(baseDir, nickname, domain,
|
_htmlEditProfileFiltering(baseDir, nickname, domain,
|
||||||
userAgentsBlocked, translate,
|
userAgentsBlocked, translate,
|
||||||
replyIntervalHours)
|
replyIntervalHours,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
# git projects section
|
# git projects section
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,9 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
|
||||||
themeName: str, boxName: str,
|
themeName: str, boxName: str,
|
||||||
systemLanguage: str,
|
systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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("'"):
|
||||||
|
|
@ -683,7 +685,8 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
|
||||||
themeName, systemLanguage, maxLikeCount,
|
themeName, systemLanguage, maxLikeCount,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
False, False, False, False)
|
False, False, False, False,
|
||||||
|
CWlists, listsEnabled)
|
||||||
if postStr:
|
if postStr:
|
||||||
historySearchForm += separatorStr + postStr
|
historySearchForm += separatorStr + postStr
|
||||||
index += 1
|
index += 1
|
||||||
|
|
@ -707,7 +710,8 @@ def htmlHashtagSearch(cssCache: {},
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
themeName: str, systemLanguage: str,
|
themeName: str, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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
|
||||||
"""
|
"""
|
||||||
|
|
@ -865,7 +869,8 @@ def htmlHashtagSearch(cssCache: {},
|
||||||
showRepeats, showIcons,
|
showRepeats, showIcons,
|
||||||
manuallyApprovesFollowers,
|
manuallyApprovesFollowers,
|
||||||
showPublicOnly,
|
showPublicOnly,
|
||||||
storeToCache, False)
|
storeToCache, False, CWlists,
|
||||||
|
listsEnabled)
|
||||||
if postStr:
|
if postStr:
|
||||||
hashtagSearchForm += separatorStr + postStr
|
hashtagSearchForm += separatorStr + postStr
|
||||||
index += 1
|
index += 1
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the timeline as html
|
"""Show the timeline as html
|
||||||
"""
|
"""
|
||||||
enableTimingLog = False
|
enableTimingLog = False
|
||||||
|
|
@ -913,7 +914,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
boxName != 'dm',
|
boxName != 'dm',
|
||||||
showIndividualPostIcons,
|
showIndividualPostIcons,
|
||||||
manuallyApproveFollowers,
|
manuallyApproveFollowers,
|
||||||
False, True, useCacheOnly)
|
False, True, useCacheOnly,
|
||||||
|
CWlists, listsEnabled)
|
||||||
_logTimelineTiming(enableTimingLog,
|
_logTimelineTiming(enableTimingLog,
|
||||||
timelineStartTime, boxName, '12')
|
timelineStartTime, boxName, '12')
|
||||||
|
|
||||||
|
|
@ -1137,7 +1139,8 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the shares timeline as html
|
"""Show the shares timeline as html
|
||||||
"""
|
"""
|
||||||
manuallyApproveFollowers = \
|
manuallyApproveFollowers = \
|
||||||
|
|
@ -1162,7 +1165,8 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlWanted(cssCache: {}, defaultTimeline: str,
|
def htmlWanted(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1189,7 +1193,8 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the wanted timeline as html
|
"""Show the wanted timeline as html
|
||||||
"""
|
"""
|
||||||
manuallyApproveFollowers = \
|
manuallyApproveFollowers = \
|
||||||
|
|
@ -1214,7 +1219,8 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInbox(cssCache: {}, defaultTimeline: str,
|
def htmlInbox(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1242,7 +1248,8 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the inbox as html
|
"""Show the inbox as html
|
||||||
"""
|
"""
|
||||||
manuallyApproveFollowers = \
|
manuallyApproveFollowers = \
|
||||||
|
|
@ -1267,7 +1274,8 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1295,7 +1303,8 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the bookmarks as html
|
"""Show the bookmarks as html
|
||||||
"""
|
"""
|
||||||
manuallyApproveFollowers = \
|
manuallyApproveFollowers = \
|
||||||
|
|
@ -1320,7 +1329,8 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1348,7 +1358,8 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1368,7 +1379,8 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1396,7 +1408,8 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1417,7 +1430,8 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1445,7 +1459,8 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1466,7 +1481,8 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1494,7 +1510,8 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1515,7 +1532,8 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
|
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1544,7 +1562,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1565,7 +1584,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1593,7 +1613,8 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: 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,
|
||||||
|
|
@ -1614,7 +1635,8 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
||||||
|
|
||||||
def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
||||||
|
|
@ -1642,7 +1664,8 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
||||||
accessKeys: {}, systemLanguage: str,
|
accessKeys: {}, systemLanguage: str,
|
||||||
maxLikeCount: int,
|
maxLikeCount: int,
|
||||||
sharedItemsFederatedDomains: [],
|
sharedItemsFederatedDomains: [],
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str,
|
||||||
|
CWlists: {}, listsEnabled: str) -> str:
|
||||||
"""Show the Outbox as html
|
"""Show the Outbox as html
|
||||||
"""
|
"""
|
||||||
manuallyApproveFollowers = \
|
manuallyApproveFollowers = \
|
||||||
|
|
@ -1664,4 +1687,5 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
allowLocalNetworkAccess, textModeBanner,
|
allowLocalNetworkAccess, textModeBanner,
|
||||||
accessKeys, systemLanguage, maxLikeCount,
|
accessKeys, systemLanguage, maxLikeCount,
|
||||||
sharedItemsFederatedDomains, signingPrivateKeyPem)
|
sharedItemsFederatedDomains, signingPrivateKeyPem,
|
||||||
|
CWlists, listsEnabled)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue