News instance type

merge-requests/30/head
Bob Mottram 2020-10-07 10:10:42 +01:00
parent 81834dfcaa
commit 9d30158618
22 changed files with 173 additions and 28 deletions

View File

@ -3436,6 +3436,7 @@ class PubServer(BaseHTTPRequestHandler):
if fields['mediaInstance'] == 'on': if fields['mediaInstance'] == 'on':
self.server.mediaInstance = True self.server.mediaInstance = True
self.server.blogsInstance = False self.server.blogsInstance = False
self.server.newsInstance = False
self.server.defaultTimeline = 'tlmedia' self.server.defaultTimeline = 'tlmedia'
setConfigParam(baseDir, setConfigParam(baseDir,
"mediaInstance", "mediaInstance",
@ -3443,6 +3444,9 @@ class PubServer(BaseHTTPRequestHandler):
setConfigParam(baseDir, setConfigParam(baseDir,
"blogsInstance", "blogsInstance",
self.server.blogsInstance) self.server.blogsInstance)
setConfigParam(baseDir,
"newsInstance",
self.server.newsInstance)
else: else:
if self.server.mediaInstance: if self.server.mediaInstance:
self.server.mediaInstance = False self.server.mediaInstance = False
@ -3451,6 +3455,32 @@ class PubServer(BaseHTTPRequestHandler):
"mediaInstance", "mediaInstance",
self.server.mediaInstance) self.server.mediaInstance)
# change news instance status
if fields.get('newsInstance'):
self.server.newsInstance = False
self.server.defaultTimeline = 'inbox'
if fields['mediaInstance'] == 'on':
self.server.newsInstance = True
self.server.blogsInstance = False
self.server.mediaInstance = False
self.server.defaultTimeline = 'tlnews'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
setConfigParam(baseDir,
"blogsInstance",
self.server.blogsInstance)
setConfigParam(baseDir,
"newsInstance",
self.server.newsInstance)
else:
if self.server.newsInstance:
self.server.newsInstance = False
self.server.defaultTimeline = 'inbox'
setConfigParam(baseDir,
"newsInstance",
self.server.mediaInstance)
# change blog instance status # change blog instance status
if fields.get('blogsInstance'): if fields.get('blogsInstance'):
self.server.blogsInstance = False self.server.blogsInstance = False
@ -3458,6 +3488,7 @@ class PubServer(BaseHTTPRequestHandler):
if fields['blogsInstance'] == 'on': if fields['blogsInstance'] == 'on':
self.server.blogsInstance = True self.server.blogsInstance = True
self.server.mediaInstance = False self.server.mediaInstance = False
self.server.newsInstance = False
self.server.defaultTimeline = 'tlblogs' self.server.defaultTimeline = 'tlblogs'
setConfigParam(baseDir, setConfigParam(baseDir,
"blogsInstance", "blogsInstance",
@ -3465,6 +3496,9 @@ class PubServer(BaseHTTPRequestHandler):
setConfigParam(baseDir, setConfigParam(baseDir,
"mediaInstance", "mediaInstance",
self.server.mediaInstance) self.server.mediaInstance)
setConfigParam(baseDir,
"newsInstance",
self.server.newsInstance)
else: else:
if self.server.blogsInstance: if self.server.blogsInstance:
self.server.blogsInstance = False self.server.blogsInstance = False
@ -8632,13 +8666,16 @@ class PubServer(BaseHTTPRequestHandler):
nickname = nickname.split('/')[0] nickname = nickname.split('/')[0]
self._setMinimal(nickname, not self._isMinimal(nickname)) self._setMinimal(nickname, not self._isMinimal(nickname))
if not (self.server.mediaInstance or if not (self.server.mediaInstance or
self.server.blogsInstance): self.server.blogsInstance or
self.server.newsInstance):
self.path = '/users/' + nickname + '/inbox' self.path = '/users/' + nickname + '/inbox'
else: else:
if self.server.blogsInstance: if self.server.blogsInstance:
self.path = '/users/' + nickname + '/tlblogs' self.path = '/users/' + nickname + '/tlblogs'
else: elif self.server.mediaInstance:
self.path = '/users/' + nickname + '/tlmedia' self.path = '/users/' + nickname + '/tlmedia'
else:
self.path = '/users/' + nickname + '/tlnews'
# search for a fediverse address, shared item or emoji # search for a fediverse address, shared item or emoji
# from the web interface by selecting search icon # from the web interface by selecting search icon
@ -11166,7 +11203,9 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None:
tokensLookup[token] = nickname tokensLookup[token] = nickname
def runDaemon(blogsInstance: bool, mediaInstance: bool, def runDaemon(newsInstance: bool,
blogsInstance: bool,
mediaInstance: bool,
maxRecentPosts: int, maxRecentPosts: int,
enableSharedInbox: bool, registration: bool, enableSharedInbox: bool, registration: bool,
language: str, projectVersion: str, language: str, projectVersion: str,
@ -11230,11 +11269,14 @@ def runDaemon(blogsInstance: bool, mediaInstance: bool,
httpd.useBlurHash = useBlurHash httpd.useBlurHash = useBlurHash
httpd.mediaInstance = mediaInstance httpd.mediaInstance = mediaInstance
httpd.blogsInstance = blogsInstance httpd.blogsInstance = blogsInstance
httpd.newsInstance = newsInstance
httpd.defaultTimeline = 'inbox' httpd.defaultTimeline = 'inbox'
if mediaInstance: if mediaInstance:
httpd.defaultTimeline = 'tlmedia' httpd.defaultTimeline = 'tlmedia'
if blogsInstance: if blogsInstance:
httpd.defaultTimeline = 'tlblogs' httpd.defaultTimeline = 'tlblogs'
if newsInstance:
httpd.defaultTimeline = 'tlnews'
# load translations dictionary # load translations dictionary
httpd.translate = {} httpd.translate = {}

View File

@ -195,6 +195,9 @@ parser.add_argument("--mediainstance", type=str2bool, nargs='?',
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")
parser.add_argument("--newsinstance", type=str2bool, nargs='?',
const=True, default=False,
help="News Instance - favor news over microblogging")
parser.add_argument("--debug", type=str2bool, nargs='?', parser.add_argument("--debug", type=str2bool, nargs='?',
const=True, default=False, const=True, default=False,
help="Show debug messages") help="Show debug messages")
@ -626,6 +629,15 @@ if not args.mediainstance:
args.mediainstance = mediaInstance args.mediainstance = mediaInstance
if args.mediainstance: if args.mediainstance:
args.blogsinstance = False args.blogsinstance = False
args.newsinstance = False
if not args.newsinstance:
newsInstance = getConfigParam(baseDir, 'newsInstance')
if newsInstance is not None:
args.newsinstance = newsInstance
if args.newsinstance:
args.blogsinstance = False
args.mediainstance = False
if not args.blogsinstance: if not args.blogsinstance:
blogsInstance = getConfigParam(baseDir, 'blogsInstance') blogsInstance = getConfigParam(baseDir, 'blogsInstance')
@ -633,6 +645,7 @@ if not args.blogsinstance:
args.blogsinstance = blogsInstance args.blogsinstance = blogsInstance
if args.blogsinstance: if args.blogsinstance:
args.mediainstance = False args.mediainstance = False
args.newsinstance = False
# set the instance title in config.json # set the instance title in config.json
title = getConfigParam(baseDir, 'instanceTitle') title = getConfigParam(baseDir, 'instanceTitle')
@ -1898,7 +1911,8 @@ if setTheme(baseDir, themeName):
print('Theme set to ' + themeName) print('Theme set to ' + themeName)
if __name__ == "__main__": if __name__ == "__main__":
runDaemon(args.blogsinstance, args.mediainstance, runDaemon(args.newsinstance,
args.blogsinstance, args.mediainstance,
args.maxRecentPosts, args.maxRecentPosts,
not args.nosharedinbox, not args.nosharedinbox,
registration, args.language, __version__, registration, args.language, __version__,

View File

@ -23,6 +23,7 @@ from webfinger import storeWebfingerEndpoint
from posts import createDMTimeline from posts import createDMTimeline
from posts import createRepliesTimeline from posts import createRepliesTimeline
from posts import createMediaTimeline from posts import createMediaTimeline
from posts import createNewsTimeline
from posts import createBlogsTimeline from posts import createBlogsTimeline
from posts import createBookmarksTimeline from posts import createBookmarksTimeline
from posts import createEventsTimeline from posts import createEventsTimeline
@ -591,7 +592,7 @@ def personBoxJson(recentPostsCache: {},
""" """
if boxname != 'inbox' and boxname != 'dm' and \ if boxname != 'inbox' and boxname != 'dm' and \
boxname != 'tlreplies' and boxname != 'tlmedia' and \ boxname != 'tlreplies' and boxname != 'tlmedia' and \
boxname != 'tlblogs' and \ boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'outbox' and boxname != 'moderation' and \ boxname != 'outbox' and boxname != 'moderation' and \
boxname != 'tlbookmarks' and boxname != 'bookmarks' and \ boxname != 'tlbookmarks' and boxname != 'bookmarks' and \
boxname != 'tlevents': boxname != 'tlevents':
@ -659,6 +660,10 @@ def personBoxJson(recentPostsCache: {},
return createMediaTimeline(session, baseDir, nickname, domain, port, return createMediaTimeline(session, baseDir, nickname, domain, port,
httpPrefix, noOfItems, headerOnly, httpPrefix, noOfItems, headerOnly,
pageNumber) pageNumber)
elif boxname == 'tlnews':
return createNewsTimeline(session, baseDir, nickname, domain, port,
httpPrefix, noOfItems, headerOnly,
pageNumber)
elif boxname == 'tlblogs': elif boxname == 'tlblogs':
return createBlogsTimeline(session, baseDir, nickname, domain, port, return createBlogsTimeline(session, baseDir, nickname, domain, port,
httpPrefix, noOfItems, headerOnly, httpPrefix, noOfItems, headerOnly,

View File

@ -505,7 +505,8 @@ def deleteAllPosts(baseDir: str,
"""Deletes all posts for a person from inbox or outbox """Deletes all posts for a person from inbox or outbox
""" """
if boxname != 'inbox' and boxname != 'outbox' and \ if boxname != 'inbox' and boxname != 'outbox' and \
boxname != 'tlblogs' and boxname != 'tlevents': boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'tlevents':
return return
boxDir = createPersonDir(nickname, domain, baseDir, boxname) boxDir = createPersonDir(nickname, domain, baseDir, boxname)
for deleteFilename in os.scandir(boxDir): for deleteFilename in os.scandir(boxDir):
@ -527,7 +528,8 @@ def savePostToBox(baseDir: str, httpPrefix: str, postId: str,
Returns the filename Returns the filename
""" """
if boxname != 'inbox' and boxname != 'outbox' and \ if boxname != 'inbox' and boxname != 'outbox' and \
boxname != 'tlblogs' and boxname != 'tlevents' and \ boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'tlevents' and \
boxname != 'scheduled': boxname != 'scheduled':
return None return None
originalDomain = domain originalDomain = domain
@ -2504,6 +2506,15 @@ def createMediaTimeline(session, baseDir: str, nickname: str, domain: str,
pageNumber) pageNumber)
def createNewsTimeline(session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, pageNumber=None) -> {}:
return createBoxIndexed({}, session, baseDir, 'tlnews', nickname,
domain, port, httpPrefix,
itemsPerPage, headerOnly, True,
pageNumber)
def createOutbox(session, baseDir: str, nickname: str, domain: str, def createOutbox(session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, port: int, httpPrefix: str,
itemsPerPage: int, headerOnly: bool, authorized: bool, itemsPerPage: int, headerOnly: bool, authorized: bool,
@ -2775,7 +2786,7 @@ def addPostStringToTimeline(postStr: str, boxname: str,
elif boxname == 'tlreplies': elif boxname == 'tlreplies':
if boxActor not in postStr: if boxActor not in postStr:
return False return False
elif boxname == 'tlblogs': elif boxname == 'tlblogs' or boxname == 'tlnews':
if '"Create"' not in postStr: if '"Create"' not in postStr:
return False return False
if '"Article"' not in postStr: if '"Article"' not in postStr:
@ -2812,7 +2823,7 @@ def createBoxIndexed(recentPostsCache: {},
if boxname != 'inbox' and boxname != 'dm' and \ if boxname != 'inbox' and boxname != 'dm' and \
boxname != 'tlreplies' and boxname != 'tlmedia' and \ boxname != 'tlreplies' and boxname != 'tlmedia' and \
boxname != 'tlblogs' and \ boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'outbox' and boxname != 'tlbookmarks' and \ boxname != 'outbox' and boxname != 'tlbookmarks' and \
boxname != 'bookmarks' and \ boxname != 'bookmarks' and \
boxname != 'tlevents': boxname != 'tlevents':

View File

@ -287,7 +287,8 @@ 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(False, False, 5, True, True, 'en', __version__, runDaemon(False, False, False,
5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,
httpPrefix, federationList, maxMentions, maxEmoji, False, httpPrefix, federationList, maxMentions, maxEmoji, False,
@ -349,7 +350,8 @@ 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(False, False, 5, True, True, 'en', __version__, runDaemon(False, False, False,
5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,
httpPrefix, federationList, maxMentions, maxEmoji, False, httpPrefix, federationList, maxMentions, maxEmoji, False,
@ -385,7 +387,8 @@ 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(False, False, 5, True, True, 'en', __version__, runDaemon(False, False, False,
5, True, True, 'en', __version__,
"instanceId", False, path, domain, "instanceId", False, path, domain,
onionDomain, i2pDomain, None, port, port, onionDomain, i2pDomain, None, port, port,
httpPrefix, federationList, maxMentions, maxEmoji, False, httpPrefix, federationList, maxMentions, maxEmoji, False,

View File

@ -302,5 +302,7 @@
"Discuss": "مناقشة", "Discuss": "مناقشة",
"Moderator Discussion": "مناقشة المنسق", "Moderator Discussion": "مناقشة المنسق",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discuteix", "Discuss": "Discuteix",
"Moderator Discussion": "Discussió sobre moderadors", "Moderator Discussion": "Discussió sobre moderadors",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Trafodwch", "Discuss": "Trafodwch",
"Moderator Discussion": "Trafodaeth Cymedrolwr", "Moderator Discussion": "Trafodaeth Cymedrolwr",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Diskutieren", "Discuss": "Diskutieren",
"Moderator Discussion": "Moderatorendiskussion", "Moderator Discussion": "Moderatorendiskussion",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discuss", "Discuss": "Discuss",
"Moderator Discussion": "Moderator Discussion", "Moderator Discussion": "Moderator Discussion",
"Vote": "Vote", "Vote": "Vote",
"Remove Vote": "Remove Vote" "Remove Vote": "Remove Vote",
"This is a news instance": "This is a news instance",
"News": "News"
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discutir", "Discuss": "Discutir",
"Moderator Discussion": "Discusión del moderador", "Moderator Discussion": "Discusión del moderador",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discuter", "Discuss": "Discuter",
"Moderator Discussion": "Discussion du modérateur", "Moderator Discussion": "Discussion du modérateur",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Pléigh", "Discuss": "Pléigh",
"Moderator Discussion": "Plé Modhnóir", "Moderator Discussion": "Plé Modhnóir",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "चर्चा करें", "Discuss": "चर्चा करें",
"Moderator Discussion": "मॉडरेटर चर्चा", "Moderator Discussion": "मॉडरेटर चर्चा",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discutere", "Discuss": "Discutere",
"Moderator Discussion": "Discussione del moderatore", "Moderator Discussion": "Discussione del moderatore",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "議論する", "Discuss": "議論する",
"Moderator Discussion": "モデレーターディスカッション", "Moderator Discussion": "モデレーターディスカッション",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -298,5 +298,7 @@
"Discuss": "Discuss", "Discuss": "Discuss",
"Moderator Discussion": "Moderator Discussion", "Moderator Discussion": "Moderator Discussion",
"Vote": "Vote", "Vote": "Vote",
"Remove Vote": "Remove Vote" "Remove Vote": "Remove Vote",
"This is a news instance": "This is a news instance",
"News": "News"
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Discutir", "Discuss": "Discutir",
"Moderator Discussion": "Discussão do moderador", "Moderator Discussion": "Discussão do moderador",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "Обсудить", "Discuss": "Обсудить",
"Moderator Discussion": "Обсуждение модератором", "Moderator Discussion": "Обсуждение модератором",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -302,5 +302,7 @@
"Discuss": "讨论", "Discuss": "讨论",
"Moderator Discussion": "主持人讨论", "Moderator Discussion": "主持人讨论",
"Vote": "", "Vote": "",
"Remove Vote": "" "Remove Vote": "",
"This is a news instance": "",
"News": ""
} }

View File

@ -728,7 +728,7 @@ def validNickname(domain: str, nickname: str) -> bool:
'public', 'followers', 'public', 'followers',
'channel', 'calendar', 'channel', 'calendar',
'tlreplies', 'tlmedia', 'tlblogs', 'tlreplies', 'tlmedia', 'tlblogs',
'tlevents', 'tlevents', 'tlblogs',
'moderation', 'activity', 'undo', 'moderation', 'activity', 'undo',
'reply', 'replies', 'question', 'like', 'reply', 'replies', 'question', 'like',
'likes', 'users', 'statuses', 'likes', 'users', 'statuses',

View File

@ -1374,6 +1374,7 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
hideLikeButton = '' hideLikeButton = ''
mediaInstanceStr = '' mediaInstanceStr = ''
blogsInstanceStr = '' blogsInstanceStr = ''
newsInstanceStr = ''
displayNickname = nickname displayNickname = nickname
bioStr = '' bioStr = ''
donateUrl = '' donateUrl = ''
@ -1432,12 +1433,21 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
if mediaInstance is True: if mediaInstance is True:
mediaInstanceStr = 'checked' mediaInstanceStr = 'checked'
blogsInstanceStr = '' blogsInstanceStr = ''
newsInstanceStr = ''
newsInstance = getConfigParam(baseDir, "newsInstance")
if newsInstance:
if newsInstance is True:
newsInstanceStr = 'checked'
blogsInstanceStr = ''
mediaInstanceStr = ''
blogsInstance = getConfigParam(baseDir, "blogsInstance") blogsInstance = getConfigParam(baseDir, "blogsInstance")
if blogsInstance: if blogsInstance:
if blogsInstance is True: if blogsInstance is True:
blogsInstanceStr = 'checked' blogsInstanceStr = 'checked'
mediaInstanceStr = '' mediaInstanceStr = ''
newsInstanceStr = ''
filterStr = '' filterStr = ''
filterFilename = \ filterFilename = \
@ -1781,6 +1791,10 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="blogsInstance" ' + blogsInstanceStr + '> ' + \ 'name="blogsInstance" ' + blogsInstanceStr + '> ' + \
translate['This is a blogging instance'] + '<br>\n' translate['This is a blogging instance'] + '<br>\n'
editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \
'name="newsInstance" ' + newsInstanceStr + '> ' + \
translate['This is a news instance'] + '<br>\n'
editProfileForm += ' </div>\n' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">\n' editProfileForm += ' <div class="container">\n'
@ -5596,6 +5610,7 @@ def htmlTimeline(defaultTimeline: str,
# the appearance of buttons - highlighted or not # the appearance of buttons - highlighted or not
inboxButton = 'button' inboxButton = 'button'
blogsButton = 'button' blogsButton = 'button'
newsButton = 'button'
dmButton = 'button' dmButton = 'button'
if newDM: if newDM:
dmButton = 'buttonhighlighted' dmButton = 'buttonhighlighted'
@ -5616,6 +5631,8 @@ def htmlTimeline(defaultTimeline: str,
inboxButton = 'buttonselected' inboxButton = 'buttonselected'
elif boxName == 'tlblogs': elif boxName == 'tlblogs':
blogsButton = 'buttonselected' blogsButton = 'buttonselected'
elif boxName == 'tlnews':
newsButton = 'buttonselected'
elif boxName == 'dm': elif boxName == 'dm':
dmButton = 'buttonselected' dmButton = 'buttonselected'
if newDM: if newDM:
@ -5812,6 +5829,12 @@ def htmlTimeline(defaultTimeline: str,
'/tlblogs"><button class="' + \ '/tlblogs"><button class="' + \
blogsButton + '"><span>' + translate['Blogs'] + \ blogsButton + '"><span>' + translate['Blogs'] + \
'</span></button></a>\n' '</span></button></a>\n'
elif defaultTimeline == 'tlnews':
tlStr += \
' <a href="' + usersPath + \
'/tlnews"><button class="' + \
newsButton + '"><span>' + translate['News'] + \
'</span></button></a>\n'
else: else:
tlStr += \ tlStr += \
' <a href="' + usersPath + \ ' <a href="' + usersPath + \
@ -5863,6 +5886,23 @@ def htmlTimeline(defaultTimeline: str,
inboxButton + '"><span>' + translate['Inbox'] + \ inboxButton + '"><span>' + translate['Inbox'] + \
'</span></button></a>\n' '</span></button></a>\n'
# typically the news button
# but may change if this is a news oriented instance
if defaultTimeline != 'tlnews':
if not minimal:
tlStr += \
' <a href="' + usersPath + \
'/tlnews"><button class="' + \
newsButton + '"><span>' + translate['News'] + \
'</span></button></a>\n'
else:
if not minimal:
tlStr += \
' <a href="' + usersPath + \
'/inbox"><button class="' + \
inboxButton + '"><span>' + translate['Inbox'] + \
'</span></button></a>\n'
# button for the outbox # button for the outbox
tlStr += \ tlStr += \
' <a href="' + usersPath + \ ' <a href="' + usersPath + \