Option to only show date at bottom of posts, not time

merge-requests/30/head
Bob Mottram 2020-10-11 19:50:13 +01:00
parent 65f4e3ad41
commit 2899768828
6 changed files with 151 additions and 43 deletions

View File

@ -954,7 +954,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.allowDeletion, self.server.allowDeletion,
self.server.proxyType, version, self.server.proxyType, version,
self.server.debug, self.server.debug,
self.server.YTReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
def _postToOutboxThread(self, messageJson: {}) -> bool: def _postToOutboxThread(self, messageJson: {}) -> bool:
"""Creates a thread to send a post """Creates a thread to send a post
@ -2253,7 +2254,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.personCache, self.server.personCache,
httpPrefix, httpPrefix,
self.server.projectVersion, self.server.projectVersion,
self.server.YTReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
if hashtagStr: if hashtagStr:
msg = hashtagStr.encode('utf-8') msg = hashtagStr.encode('utf-8')
self._login_headers('text/html', self._login_headers('text/html',
@ -2298,7 +2300,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers, self.server.cachedWebfingers,
self.server.personCache, self.server.personCache,
port, port,
self.server.YTReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
if historyStr: if historyStr:
msg = historyStr.encode('utf-8') msg = historyStr.encode('utf-8')
self._login_headers('text/html', self._login_headers('text/html',
@ -2341,7 +2344,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.personCache, self.server.personCache,
self.server.debug, self.server.debug,
self.server.projectVersion, self.server.projectVersion,
self.server.YTReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
if profileStr: if profileStr:
msg = profileStr.encode('utf-8') msg = profileStr.encode('utf-8')
self._login_headers('text/html', self._login_headers('text/html',
@ -4542,7 +4546,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.personCache, self.server.personCache,
httpPrefix, httpPrefix,
self.server.projectVersion, self.server.projectVersion,
self.server.YTReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
if hashtagStr: if hashtagStr:
msg = hashtagStr.encode('utf-8') msg = hashtagStr.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
@ -5448,7 +5453,8 @@ class PubServer(BaseHTTPRequestHandler):
deleteUrl, httpPrefix, deleteUrl, httpPrefix,
__version__, self.server.cachedWebfingers, __version__, self.server.cachedWebfingers,
self.server.personCache, callingDomain, self.server.personCache, callingDomain,
self.server.TYReplacementDomain) self.server.YTReplacementDomain,
self.server.showPublishedDateOnly)
if deleteStr: if deleteStr:
self._set_headers('text/html', len(deleteStr), self._set_headers('text/html', len(deleteStr),
cookie, callingDomain) cookie, callingDomain)
@ -5647,7 +5653,8 @@ class PubServer(BaseHTTPRequestHandler):
repliesJson, repliesJson,
httpPrefix, httpPrefix,
projectVersion, projectVersion,
ytDomain) ytDomain,
self.server.showPublishedDateOnly)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -5727,7 +5734,8 @@ class PubServer(BaseHTTPRequestHandler):
repliesJson, repliesJson,
httpPrefix, httpPrefix,
projectVersion, projectVersion,
ytDomain) ytDomain,
self.server.showPublishedDateOnly)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -5802,6 +5810,7 @@ class PubServer(BaseHTTPRequestHandler):
cachedWebfingers, cachedWebfingers,
self.server.personCache, self.server.personCache,
YTReplacementDomain, YTReplacementDomain,
self.server.showPublishedDateOnly,
actorJson['roles'], actorJson['roles'],
None, None) None, None)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -5860,6 +5869,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers self.server.cachedWebfingers
YTReplacementDomain = \ YTReplacementDomain = \
self.server.YTReplacementDomain self.server.YTReplacementDomain
showPublishedDateOnly = \
self.server.showPublishedDateOnly
msg = \ msg = \
htmlProfile(defaultTimeline, htmlProfile(defaultTimeline,
recentPostsCache, recentPostsCache,
@ -5872,6 +5883,7 @@ class PubServer(BaseHTTPRequestHandler):
cachedWebfingers, cachedWebfingers,
self.server.personCache, self.server.personCache,
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
actorJson['skills'], actorJson['skills'],
None, None) None, None)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -5972,6 +5984,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion self.server.projectVersion
ytDomain = \ ytDomain = \
self.server.YTReplacementDomain self.server.YTReplacementDomain
showPublishedDateOnly = \
self.server.showPublishedDateOnly
msg = \ msg = \
htmlIndividualPost(recentPostsCache, htmlIndividualPost(recentPostsCache,
maxRecentPosts, maxRecentPosts,
@ -5987,7 +6001,8 @@ class PubServer(BaseHTTPRequestHandler):
httpPrefix, httpPrefix,
projectVersion, projectVersion,
likedBy, likedBy,
ytDomain) ytDomain,
showPublishedDateOnly)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -6079,6 +6094,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion self.server.projectVersion
ytDomain = \ ytDomain = \
self.server.YTReplacementDomain self.server.YTReplacementDomain
showPublishedDateOnly = \
self.server.showPublishedDateOnly
msg = \ msg = \
htmlIndividualPost(recentPostsCache, htmlIndividualPost(recentPostsCache,
maxRecentPosts, maxRecentPosts,
@ -6095,7 +6112,8 @@ class PubServer(BaseHTTPRequestHandler):
httpPrefix, httpPrefix,
projectVersion, projectVersion,
likedBy, likedBy,
ytDomain) ytDomain,
showPublishedDateOnly)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -6212,6 +6230,7 @@ class PubServer(BaseHTTPRequestHandler):
projectVersion, projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
YTReplacementDomain, YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
if GETstartTime: if GETstartTime:
@ -6325,6 +6344,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6431,6 +6451,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6537,6 +6558,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6643,6 +6665,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6756,6 +6779,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, moderator, self.server.newswire, moderator,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6832,6 +6856,7 @@ class PubServer(BaseHTTPRequestHandler):
httpPrefix, httpPrefix,
self.server.projectVersion, self.server.projectVersion,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -6922,6 +6947,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -7031,6 +7057,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -7132,6 +7159,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion, self.server.projectVersion,
self._isMinimal(nickname), self._isMinimal(nickname),
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -7223,6 +7251,7 @@ class PubServer(BaseHTTPRequestHandler):
httpPrefix, httpPrefix,
self.server.projectVersion, self.server.projectVersion,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.newswire, self.server.newswire,
self.server.positiveVoting) self.server.positiveVoting)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -7314,6 +7343,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers, self.server.cachedWebfingers,
self.server.personCache, self.server.personCache,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
shares, shares,
pageNumber, sharesPerPage) pageNumber, sharesPerPage)
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
@ -7400,6 +7430,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers, self.server.cachedWebfingers,
self.server.personCache, self.server.personCache,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
following, following,
pageNumber, pageNumber,
followsPerPage).encode('utf-8') followsPerPage).encode('utf-8')
@ -7486,6 +7517,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers, self.server.cachedWebfingers,
self.server.personCache, self.server.personCache,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
followers, followers,
pageNumber, pageNumber,
followsPerPage).encode('utf-8') followsPerPage).encode('utf-8')
@ -7547,6 +7579,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.cachedWebfingers, self.server.cachedWebfingers,
self.server.personCache, self.server.personCache,
self.server.YTReplacementDomain, self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
None, None).encode('utf-8') None, None).encode('utf-8')
self._set_headers('text/html', len(msg), self._set_headers('text/html', len(msg),
cookie, callingDomain) cookie, callingDomain)
@ -11610,7 +11643,8 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None:
tokensLookup[token] = nickname tokensLookup[token] = nickname
def runDaemon(votingTimeMins: int, def runDaemon(showPublishedDateOnly: bool,
votingTimeMins: int,
positiveVoting: bool, positiveVoting: bool,
newswireVotesThreshold: int, newswireVotesThreshold: int,
newsInstance: bool, newsInstance: bool,
@ -11730,6 +11764,9 @@ def runDaemon(votingTimeMins: int,
# or if positive voting is anabled to add the item to the news timeline # or if positive voting is anabled to add the item to the news timeline
httpd.newswireVotesThreshold = newswireVotesThreshold httpd.newswireVotesThreshold = newswireVotesThreshold
# Show only the date at the bottom of posts, and not the time
httpd.showPublishedDateOnly = showPublishedDateOnly
if registration == 'open': if registration == 'open':
httpd.registration = True httpd.registration = True
else: else:
@ -11860,7 +11897,8 @@ def runDaemon(votingTimeMins: int,
domainMaxPostsPerDay, accountMaxPostsPerDay, domainMaxPostsPerDay, accountMaxPostsPerDay,
allowDeletion, debug, maxMentions, maxEmoji, allowDeletion, debug, maxMentions, maxEmoji,
httpd.translate, unitTest, httpd.translate, unitTest,
httpd.YTReplacementDomain), daemon=True) httpd.YTReplacementDomain,
httpd.showPublishedDateOnly), daemon=True)
print('Creating scheduled post thread') print('Creating scheduled post thread')
httpd.thrPostSchedule = \ httpd.thrPostSchedule = \

View File

@ -192,6 +192,9 @@ parser.add_argument("--noapproval", type=str2bool, nargs='?',
parser.add_argument("--mediainstance", type=str2bool, nargs='?', parser.add_argument("--mediainstance", type=str2bool, nargs='?',
const=True, default=False, const=True, default=False,
help="Media Instance - favor media over text") help="Media Instance - favor media over text")
parser.add_argument("--dateonly", type=str2bool, nargs='?',
const=True, default=False,
help="Only show the date at the bottom of posts")
parser.add_argument("--blogsinstance", type=str2bool, nargs='?', parser.add_argument("--blogsinstance", type=str2bool, nargs='?',
const=True, default=False, const=True, default=False,
help="Blogs Instance - favor blogs over microblogging") help="Blogs Instance - favor blogs over microblogging")
@ -1917,6 +1920,11 @@ votingtime = getConfigParam(baseDir, 'votingtime')
if votingtime: if votingtime:
args.votingtime = votingtime args.votingtime = votingtime
# only show the date at the bottom of posts
dateonly = getConfigParam(baseDir, 'dateonly')
if dateonly:
args.dateonly = dateonly
YTDomain = getConfigParam(baseDir, 'youtubedomain') YTDomain = getConfigParam(baseDir, 'youtubedomain')
if YTDomain: if YTDomain:
if '://' in YTDomain: if '://' in YTDomain:
@ -1930,7 +1938,8 @@ if setTheme(baseDir, themeName, domain):
print('Theme set to ' + themeName) print('Theme set to ' + themeName)
if __name__ == "__main__": if __name__ == "__main__":
runDaemon(args.votingtime, runDaemon(args.dateonly,
args.votingtime,
args.positivevoting, args.positivevoting,
args.minimumvotes, args.minimumvotes,
args.newsinstance, args.newsinstance,

View File

@ -129,7 +129,8 @@ def inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
session, cachedWebfingers: {}, personCache: {}, session, cachedWebfingers: {}, personCache: {},
nickname: str, domain: str, port: int, nickname: str, domain: str, port: int,
postJsonObject: {}, postJsonObject: {},
allowDeletion: bool, boxname: str) -> None: allowDeletion: bool, boxname: str,
showPublishedDateOnly: bool) -> 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
""" """
@ -142,7 +143,8 @@ def inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
baseDir, session, cachedWebfingers, personCache, baseDir, session, cachedWebfingers, personCache,
nickname, domain, port, postJsonObject, nickname, domain, port, postJsonObject,
avatarUrl, True, allowDeletion, avatarUrl, True, allowDeletion,
httpPrefix, __version__, boxname, httpPrefix, __version__, boxname, None,
showPublishedDateOnly,
not isDM(postJsonObject), not isDM(postJsonObject),
True, True, False, True) True, True, False, True)
@ -2027,7 +2029,8 @@ def inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
queueFilename: str, destinationFilename: str, queueFilename: str, destinationFilename: str,
maxReplies: int, allowDeletion: bool, maxReplies: int, allowDeletion: bool,
maxMentions: int, maxEmoji: int, translate: {}, maxMentions: int, maxEmoji: int, translate: {},
unitTest: bool, YTReplacementDomain: str) -> bool: unitTest: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool) -> 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
@ -2337,7 +2340,8 @@ def inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
domain, port, domain, port,
postJsonObject, postJsonObject,
allowDeletion, allowDeletion,
boxname) boxname,
showPublishedDateOnly)
if debug: if debug:
timeDiff = \ timeDiff = \
str(int((time.time() - htmlCacheStartTime) * str(int((time.time() - htmlCacheStartTime) *
@ -2431,7 +2435,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
domainMaxPostsPerDay: int, accountMaxPostsPerDay: int, domainMaxPostsPerDay: int, accountMaxPostsPerDay: int,
allowDeletion: bool, debug: bool, maxMentions: int, allowDeletion: bool, debug: bool, maxMentions: int,
maxEmoji: int, translate: {}, unitTest: bool, maxEmoji: int, translate: {}, unitTest: bool,
YTReplacementDomain: str) -> None: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> None:
"""Processes received items and moves them to the appropriate """Processes received items and moves them to the appropriate
directories directories
""" """
@ -2843,7 +2848,8 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
maxReplies, allowDeletion, maxReplies, allowDeletion,
maxMentions, maxEmoji, maxMentions, maxEmoji,
translate, unitTest, translate, unitTest,
YTReplacementDomain) YTReplacementDomain,
showPublishedDateOnly)
if debug: if debug:
pprint(queueJson['post']) pprint(queueJson['post'])

View File

@ -45,7 +45,8 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
postLog: [], cachedWebfingers: {}, postLog: [], cachedWebfingers: {},
personCache: {}, allowDeletion: bool, personCache: {}, allowDeletion: bool,
proxyType: str, version: str, debug: bool, proxyType: str, version: str, debug: bool,
YTReplacementDomain: str) -> bool: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> 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

View File

@ -288,7 +288,7 @@ def createServerAlice(path: str, domain: str, port: int,
onionDomain = None onionDomain = None
i2pDomain = None i2pDomain = None
print('Server running: Alice') print('Server running: Alice')
runDaemon(0, False, 1, False, False, False, runDaemon(False, 0, False, 1, False, False, False,
5, True, True, 'en', __version__, 5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,
@ -351,7 +351,7 @@ def createServerBob(path: str, domain: str, port: int,
onionDomain = None onionDomain = None
i2pDomain = None i2pDomain = None
print('Server running: Bob') print('Server running: Bob')
runDaemon(0, False, 1, False, False, False, runDaemon(False, 0, False, 1, False, False, False,
5, True, True, 'en', __version__, 5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,
@ -388,7 +388,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
onionDomain = None onionDomain = None
i2pDomain = None i2pDomain = None
print('Server running: Eve') print('Server running: Eve')
runDaemon(0, False, 1, False, False, False, runDaemon(False, 0, False, 1, False, False, False,
5, True, True, 'en', __version__, 5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,

View File

@ -710,7 +710,8 @@ def htmlHashtagSearch(nickname: str, domain: str, port: int,
postsPerPage: int, postsPerPage: int,
session, wfRequest: {}, personCache: {}, session, wfRequest: {}, personCache: {},
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> str:
"""Show a page containing search results for a hashtag """Show a page containing search results for a hashtag
""" """
if hashtag.startswith('#'): if hashtag.startswith('#'):
@ -830,6 +831,7 @@ def htmlHashtagSearch(nickname: str, domain: str, port: int,
httpPrefix, projectVersion, httpPrefix, projectVersion,
'search', 'search',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
showIndividualPostIcons, showIndividualPostIcons,
showIndividualPostIcons, showIndividualPostIcons,
False, False, False) False, False, False)
@ -1116,7 +1118,8 @@ def htmlHistorySearch(translate: {}, baseDir: str,
wfRequest, wfRequest,
personCache: {}, personCache: {},
port: int, port: int,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> 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('!'):
@ -1188,6 +1191,7 @@ def htmlHistorySearch(translate: {}, baseDir: str,
httpPrefix, projectVersion, httpPrefix, projectVersion,
'search', 'search',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
showIndividualPostIcons, showIndividualPostIcons,
showIndividualPostIcons, showIndividualPostIcons,
False, False, False) False, False, False)
@ -2931,7 +2935,8 @@ def htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
nickname: str, domain: str, port: int, nickname: str, domain: str, port: int,
session, wfRequest: {}, personCache: {}, session, wfRequest: {}, personCache: {},
projectVersion: str, projectVersion: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> 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
""" """
@ -2965,6 +2970,7 @@ def htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, False, False, True, False) False, False, False, True, False)
if postStr: if postStr:
profileStr += postStr profileStr += postStr
@ -3217,6 +3223,7 @@ def htmlProfile(defaultTimeline: str,
profileJson: {}, selected: str, profileJson: {}, selected: str,
session, wfRequest: {}, personCache: {}, session, wfRequest: {}, personCache: {},
YTReplacementDomain: str, YTReplacementDomain: str,
showPublishedDateOnly: bool,
extraJson=None, extraJson=None,
pageNumber=None, maxItemsPerPage=None) -> str: pageNumber=None, maxItemsPerPage=None) -> str:
"""Show the profile page as html """Show the profile page as html
@ -3477,7 +3484,8 @@ def htmlProfile(defaultTimeline: str,
nickname, domain, port, nickname, domain, port,
session, wfRequest, personCache, session, wfRequest, personCache,
projectVersion, projectVersion,
YTReplacementDomain) + licenseStr YTReplacementDomain,
showPublishedDateOnly) + licenseStr
if selected == 'following': if selected == 'following':
profileStr += \ profileStr += \
htmlProfileFollowing(translate, baseDir, httpPrefix, htmlProfileFollowing(translate, baseDir, httpPrefix,
@ -4262,6 +4270,7 @@ def individualPostAsHtml(allowDownloads: bool,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
boxName: str, YTReplacementDomain: str, boxName: str, YTReplacementDomain: str,
showPublishedDateOnly: bool,
showRepeats=True, showRepeats=True,
showIcons=False, showIcons=False,
manuallyApprovesFollowers=False, manuallyApprovesFollowers=False,
@ -5146,7 +5155,10 @@ def individualPostAsHtml(allowDownloads: bool,
publishedStr = \ publishedStr = \
publishedStr.replace('T', ' ').split('.')[0] publishedStr.replace('T', ' ').split('.')[0]
datetimeObject = parse(publishedStr) datetimeObject = parse(publishedStr)
publishedStr = datetimeObject.strftime("%a %b %d, %H:%M") if not showPublishedDateOnly:
publishedStr = datetimeObject.strftime("%a %b %d, %H:%M")
else:
publishedStr = datetimeObject.strftime("%a %b %d")
# benchmark 15 # benchmark 15
if not allowDownloads: if not allowDownloads:
@ -5640,6 +5652,7 @@ def htmlTimeline(defaultTimeline: str,
manuallyApproveFollowers: bool, manuallyApproveFollowers: bool,
minimal: bool, minimal: bool,
YTReplacementDomain: str, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, moderator: bool, newswire: {}, moderator: bool,
positiveVoting: bool) -> str: positiveVoting: bool) -> str:
"""Show the timeline as html """Show the timeline as html
@ -6250,6 +6263,7 @@ def htmlTimeline(defaultTimeline: str,
httpPrefix, projectVersion, httpPrefix, projectVersion,
boxName, boxName,
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
boxName != 'dm', boxName != 'dm',
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
@ -6316,6 +6330,7 @@ def htmlShares(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
YTReplacementDomain: str, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the shares timeline as html """Show the shares timeline as html
""" """
@ -6328,7 +6343,9 @@ def htmlShares(defaultTimeline: str,
nickname, domain, port, None, nickname, domain, port, None,
'tlshares', allowDeletion, 'tlshares', allowDeletion,
httpPrefix, projectVersion, manuallyApproveFollowers, httpPrefix, projectVersion, manuallyApproveFollowers,
False, YTReplacementDomain, newswire, False, False, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6340,6 +6357,7 @@ def htmlInbox(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the inbox as html """Show the inbox as html
""" """
@ -6352,7 +6370,9 @@ def htmlInbox(defaultTimeline: str,
nickname, domain, port, inboxJson, nickname, domain, port, inboxJson,
'inbox', allowDeletion, 'inbox', allowDeletion,
httpPrefix, projectVersion, manuallyApproveFollowers, httpPrefix, projectVersion, manuallyApproveFollowers,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6364,6 +6384,7 @@ def htmlBookmarks(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the bookmarks as html """Show the bookmarks as html
""" """
@ -6376,7 +6397,9 @@ def htmlBookmarks(defaultTimeline: str,
nickname, domain, port, bookmarksJson, nickname, domain, port, bookmarksJson,
'tlbookmarks', allowDeletion, 'tlbookmarks', allowDeletion,
httpPrefix, projectVersion, manuallyApproveFollowers, httpPrefix, projectVersion, manuallyApproveFollowers,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6388,6 +6411,7 @@ def htmlEvents(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the events as html """Show the events as html
""" """
@ -6400,7 +6424,9 @@ def htmlEvents(defaultTimeline: str,
nickname, domain, port, bookmarksJson, nickname, domain, port, bookmarksJson,
'tlevents', allowDeletion, 'tlevents', allowDeletion,
httpPrefix, projectVersion, manuallyApproveFollowers, httpPrefix, projectVersion, manuallyApproveFollowers,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6412,6 +6438,7 @@ def htmlInboxDMs(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the DM timeline as html """Show the DM timeline as html
""" """
@ -6420,7 +6447,8 @@ def htmlInboxDMs(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'dm', allowDeletion, nickname, domain, port, inboxJson, 'dm', allowDeletion,
httpPrefix, projectVersion, False, minimal, httpPrefix, projectVersion, False, minimal,
YTReplacementDomain, newswire, False, positiveVoting) YTReplacementDomain, showPublishedDateOnly,
newswire, False, positiveVoting)
def htmlInboxReplies(defaultTimeline: str, def htmlInboxReplies(defaultTimeline: str,
@ -6431,6 +6459,7 @@ def htmlInboxReplies(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the replies timeline as html """Show the replies timeline as html
""" """
@ -6439,7 +6468,9 @@ def htmlInboxReplies(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'tlreplies', nickname, domain, port, inboxJson, 'tlreplies',
allowDeletion, httpPrefix, projectVersion, False, allowDeletion, httpPrefix, projectVersion, False,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6451,6 +6482,7 @@ def htmlInboxMedia(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the media timeline as html """Show the media timeline as html
""" """
@ -6459,7 +6491,9 @@ def htmlInboxMedia(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'tlmedia', nickname, domain, port, inboxJson, 'tlmedia',
allowDeletion, httpPrefix, projectVersion, False, allowDeletion, httpPrefix, projectVersion, False,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6471,6 +6505,7 @@ def htmlInboxBlogs(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the blogs timeline as html """Show the blogs timeline as html
""" """
@ -6479,7 +6514,9 @@ def htmlInboxBlogs(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'tlblogs', nickname, domain, port, inboxJson, 'tlblogs',
allowDeletion, httpPrefix, projectVersion, False, allowDeletion, httpPrefix, projectVersion, False,
minimal, YTReplacementDomain, newswire, False, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, False,
positiveVoting) positiveVoting)
@ -6491,6 +6528,7 @@ def htmlInboxNews(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, moderator: bool, newswire: {}, moderator: bool,
positiveVoting: bool) -> str: positiveVoting: bool) -> str:
"""Show the news timeline as html """Show the news timeline as html
@ -6500,7 +6538,9 @@ def htmlInboxNews(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'tlnews', nickname, domain, port, inboxJson, 'tlnews',
allowDeletion, httpPrefix, projectVersion, False, allowDeletion, httpPrefix, projectVersion, False,
minimal, YTReplacementDomain, newswire, moderator, minimal, YTReplacementDomain,
showPublishedDateOnly,
newswire, moderator,
positiveVoting) positiveVoting)
@ -6512,6 +6552,7 @@ def htmlModeration(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
YTReplacementDomain: str, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the moderation feed as html """Show the moderation feed as html
""" """
@ -6520,7 +6561,8 @@ def htmlModeration(defaultTimeline: str,
itemsPerPage, session, baseDir, wfRequest, personCache, itemsPerPage, session, baseDir, wfRequest, personCache,
nickname, domain, port, inboxJson, 'moderation', nickname, domain, port, inboxJson, 'moderation',
allowDeletion, httpPrefix, projectVersion, True, False, allowDeletion, httpPrefix, projectVersion, True, False,
YTReplacementDomain, newswire, False, positiveVoting) YTReplacementDomain, showPublishedDateOnly,
newswire, False, positiveVoting)
def htmlOutbox(defaultTimeline: str, def htmlOutbox(defaultTimeline: str,
@ -6531,6 +6573,7 @@ def htmlOutbox(defaultTimeline: str,
allowDeletion: bool, allowDeletion: bool,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
minimal: bool, YTReplacementDomain: str, minimal: bool, YTReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, positiveVoting: bool) -> str: newswire: {}, positiveVoting: bool) -> str:
"""Show the Outbox as html """Show the Outbox as html
""" """
@ -6542,7 +6585,8 @@ def htmlOutbox(defaultTimeline: str,
nickname, domain, port, outboxJson, 'outbox', nickname, domain, port, outboxJson, 'outbox',
allowDeletion, httpPrefix, projectVersion, allowDeletion, httpPrefix, projectVersion,
manuallyApproveFollowers, minimal, manuallyApproveFollowers, minimal,
YTReplacementDomain, newswire, False, positiveVoting) YTReplacementDomain, showPublishedDateOnly,
newswire, False, positiveVoting)
def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int, def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
@ -6551,7 +6595,8 @@ def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
nickname: str, domain: str, port: int, authorized: bool, nickname: str, domain: str, port: int, authorized: bool,
postJsonObject: {}, httpPrefix: str, postJsonObject: {}, httpPrefix: str,
projectVersion: str, likedBy: str, projectVersion: str, likedBy: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> str:
"""Show an individual post as html """Show an individual post as html
""" """
iconsDir = getIconsDir(baseDir) iconsDir = getIconsDir(baseDir)
@ -6596,6 +6641,7 @@ def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, authorized, False, False, False) False, authorized, False, False, False)
messageId = removeIdEnding(postJsonObject['id']) messageId = removeIdEnding(postJsonObject['id'])
@ -6620,6 +6666,7 @@ def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, authorized, False, authorized,
False, False, False) + postStr False, False, False) + postStr
@ -6647,6 +6694,7 @@ def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, authorized, False, authorized,
False, False, False) False, False, False)
cssFilename = baseDir + '/epicyon-profile.css' cssFilename = baseDir + '/epicyon-profile.css'
@ -6665,7 +6713,8 @@ def htmlPostReplies(recentPostsCache: {}, maxRecentPosts: int,
session, wfRequest: {}, personCache: {}, session, wfRequest: {}, personCache: {},
nickname: str, domain: str, port: int, repliesJson: {}, nickname: str, domain: str, port: int, repliesJson: {},
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> str:
"""Show the replies to an individual post as html """Show the replies to an individual post as html
""" """
iconsDir = getIconsDir(baseDir) iconsDir = getIconsDir(baseDir)
@ -6681,6 +6730,7 @@ def htmlPostReplies(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, False, False, False, False) False, False, False, False, False)
cssFilename = baseDir + '/epicyon-profile.css' cssFilename = baseDir + '/epicyon-profile.css'
@ -6769,7 +6819,8 @@ def htmlDeletePost(recentPostsCache: {}, maxRecentPosts: int,
httpPrefix: str, projectVersion: str, httpPrefix: str, projectVersion: str,
wfRequest: {}, personCache: {}, wfRequest: {}, personCache: {},
callingDomain: str, callingDomain: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> 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:
@ -6814,6 +6865,7 @@ def htmlDeletePost(recentPostsCache: {}, maxRecentPosts: int,
None, True, False, None, True, False,
httpPrefix, projectVersion, 'outbox', httpPrefix, projectVersion, 'outbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, False, False, False, False) False, False, False, False, False)
deletePostStr += '<center>' deletePostStr += '<center>'
deletePostStr += \ deletePostStr += \
@ -7788,7 +7840,8 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
profileHandle: str, profileHandle: str,
session, cachedWebfingers: {}, personCache: {}, session, cachedWebfingers: {}, personCache: {},
debug: bool, projectVersion: str, debug: bool, projectVersion: str,
YTReplacementDomain: str) -> str: YTReplacementDomain: str,
showPublishedDateOnly: bool) -> str:
"""Show a profile page after a search for a fediverse address """Show a profile page after a search for a fediverse address
""" """
if '/users/' in profileHandle or \ if '/users/' in profileHandle or \
@ -7996,6 +8049,7 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
item, avatarUrl, False, False, item, avatarUrl, False, False,
httpPrefix, projectVersion, 'inbox', httpPrefix, projectVersion, 'inbox',
YTReplacementDomain, YTReplacementDomain,
showPublishedDateOnly,
False, False, False, False, False) False, False, False, False, False)
i += 1 i += 1
if i >= 20: if i >= 20: