Use recent posts cache on other timelines

main
Bob Mottram 2020-08-26 11:21:24 +01:00
parent 0dc6d39de5
commit 0ac5feb992
2 changed files with 16 additions and 9 deletions

View File

@ -640,7 +640,8 @@ def personBoxJson(recentPostsCache: {},
httpPrefix,
noOfItems, headerOnly, ocapAlways, pageNumber)
elif boxname == 'dm':
return createDMTimeline(session, baseDir, nickname, domain, port,
return createDMTimeline(recentPostsCache,
session, baseDir, nickname, domain, port,
httpPrefix,
noOfItems, headerOnly, ocapAlways, pageNumber)
elif boxname == 'tlbookmarks' or boxname == 'bookmarks':
@ -649,12 +650,14 @@ def personBoxJson(recentPostsCache: {},
noOfItems, headerOnly, ocapAlways,
pageNumber)
elif boxname == 'tlevents':
return createEventsTimeline(session, baseDir, nickname, domain,
return createEventsTimeline(recentPostsCache,
session, baseDir, nickname, domain,
port, httpPrefix,
noOfItems, headerOnly, ocapAlways,
pageNumber)
elif boxname == 'tlreplies':
return createRepliesTimeline(session, baseDir, nickname, domain,
return createRepliesTimeline(recentPostsCache,
session, baseDir, nickname, domain,
port, httpPrefix,
noOfItems, headerOnly, ocapAlways,
pageNumber)

View File

@ -2449,30 +2449,34 @@ def createBookmarksTimeline(session, baseDir: str, nickname: str, domain: str,
True, ocapAlways, pageNumber)
def createEventsTimeline(session, baseDir: str, nickname: str, domain: str,
def createEventsTimeline(recentPostsCache: {},
session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, ocapAlways: bool,
pageNumber=None) -> {}:
return createBoxIndexed({}, session, baseDir, 'tlevents',
return createBoxIndexed(recentPostsCache, session, baseDir, 'tlevents',
nickname, domain,
port, httpPrefix, itemsPerPage, headerOnly,
True, ocapAlways, pageNumber)
def createDMTimeline(session, baseDir: str, nickname: str, domain: str,
def createDMTimeline(recentPostsCache: {},
session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, ocapAlways: bool,
pageNumber=None) -> {}:
return createBoxIndexed({}, session, baseDir, 'dm', nickname,
return createBoxIndexed(recentPostsCache,
session, baseDir, 'dm', nickname,
domain, port, httpPrefix, itemsPerPage,
headerOnly, True, ocapAlways, pageNumber)
def createRepliesTimeline(session, baseDir: str, nickname: str, domain: str,
def createRepliesTimeline(recentPostsCache: {},
session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, ocapAlways: bool,
pageNumber=None) -> {}:
return createBoxIndexed({}, session, baseDir, 'tlreplies',
return createBoxIndexed(recentPostsCache, session, baseDir, 'tlreplies',
nickname, domain, port, httpPrefix,
itemsPerPage, headerOnly, True,
ocapAlways, pageNumber)