From dca3da71b5542395602505e8a5d18c7cff981b7a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 May 2020 20:58:21 +0100 Subject: [PATCH] Creating bookmarks timeline --- daemon.py | 6 +++++- person.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 694a1bb72..25c859acc 100644 --- a/daemon.py +++ b/daemon.py @@ -3825,7 +3825,9 @@ class PubServer(BaseHTTPRequestHandler): # get the bookmarks for a given person if self.path.endswith('/tlbookmarks') or \ - '/tlbookmarks?page=' in self.path: + '/tlbookmarks?page=' in self.path or \ + self.path.endswith('/bookmarks') or \ + '/bookmarks?page=' in self.path: if '/users/' in self.path: if authorized: bookmarksFeed = \ @@ -3842,6 +3844,7 @@ class PubServer(BaseHTTPRequestHandler): if self._requestHTTP(): nickname = self.path.replace('/users/', '') nickname = nickname.replace('/tlbookmarks', '') + nickname = nickname.replace('/bookmarks', '') pageNumber = 1 if '?page=' in nickname: pageNumber = nickname.split('?page=')[1] @@ -3902,6 +3905,7 @@ class PubServer(BaseHTTPRequestHandler): if self.server.debug: nickname = self.path.replace('/users/', '') nickname = nickname.replace('/tlbookmarks', '') + nickname = nickname.replace('/bookmarks', '') print('DEBUG: ' + nickname + ' was not authorized to access ' + self.path) if self.server.debug: diff --git a/person.py b/person.py index 82fcde93c..f1577848e 100644 --- a/person.py +++ b/person.py @@ -546,7 +546,7 @@ def personBoxJson(recentPostsCache: {}, boxname != 'tlreplies' and boxname != 'tlmedia' and \ boxname != 'tlblogs' and \ boxname != 'outbox' and boxname != 'moderation' and \ - boxname != 'tlbookmarks': + boxname != 'tlbookmarks' and boxname != 'bookmarks': return None if not '/' + boxname in path: @@ -589,7 +589,7 @@ def personBoxJson(recentPostsCache: {}, return createDMTimeline(session, baseDir, nickname, domain, port, httpPrefix, noOfItems, headerOnly, ocapAlways, pageNumber) - elif boxname == 'tlbookmarks': + elif boxname == 'tlbookmarks' or boxname == 'bookmarks': return createBookmarksTimeline(session, baseDir, nickname, domain, port, httpPrefix, noOfItems, headerOnly, ocapAlways,