From 08ff5b420c5afbd4afe0fea86dc56ca7218abda8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 26 Aug 2020 10:29:51 +0100 Subject: [PATCH] Single events timeline name --- daemon.py | 5 +++-- person.py | 4 ++-- posts.py | 5 +---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/daemon.py b/daemon.py index 8af19676d..98b1623fe 100644 --- a/daemon.py +++ b/daemon.py @@ -4831,6 +4831,9 @@ class PubServer(BaseHTTPRequestHandler): '/events?page=' in self.path: if '/users/' in self.path: if authorized: + if self.path.endswith('/events') or \ + '/events?page=' in self.path: + self.path = self.path.replace('/events', '/tlevents') eventsFeed = \ personBoxJson(self.server.recentPostsCache, self.server.session, @@ -4845,7 +4848,6 @@ class PubServer(BaseHTTPRequestHandler): if self._requestHTTP(): nickname = self.path.replace('/users/', '') nickname = nickname.replace('/tlevents', '') - nickname = nickname.replace('/events', '') pageNumber = 1 if '?page=' in nickname: pageNumber = nickname.split('?page=')[1] @@ -4908,7 +4910,6 @@ class PubServer(BaseHTTPRequestHandler): if self.server.debug: nickname = self.path.replace('/users/', '') nickname = nickname.replace('/tlevents', '') - nickname = nickname.replace('/events', '') print('DEBUG: ' + nickname + ' was not authorized to access ' + self.path) if self.server.debug: diff --git a/person.py b/person.py index 4f0477bcd..184ea1f80 100644 --- a/person.py +++ b/person.py @@ -600,7 +600,7 @@ def personBoxJson(recentPostsCache: {}, boxname != 'tlblogs' and \ boxname != 'outbox' and boxname != 'moderation' and \ boxname != 'tlbookmarks' and boxname != 'bookmarks' and \ - boxname != 'tlevents' and boxname != 'events': + boxname != 'tlevents': return None if not '/' + boxname in path: @@ -648,7 +648,7 @@ def personBoxJson(recentPostsCache: {}, port, httpPrefix, noOfItems, headerOnly, ocapAlways, pageNumber) - elif boxname == 'tlevents' or boxname == 'events': + elif boxname == 'tlevents': return createEventsTimeline(session, baseDir, nickname, domain, port, httpPrefix, noOfItems, headerOnly, ocapAlways, diff --git a/posts.py b/posts.py index 8ac971683..90e36754d 100644 --- a/posts.py +++ b/posts.py @@ -2832,7 +2832,7 @@ def createBoxIndexed(recentPostsCache: {}, boxname != 'tlblogs' and \ boxname != 'outbox' and boxname != 'tlbookmarks' and \ boxname != 'bookmarks' and \ - boxname != 'tlevents' and boxname != 'events': + boxname != 'tlevents': return None # bookmarks and events timelines are like the inbox @@ -2841,9 +2841,6 @@ def createBoxIndexed(recentPostsCache: {}, if boxname == "tlbookmarks": boxname = "bookmarks" indexBoxName = boxname - elif boxname == "tlevents": - boxname = "events" - indexBoxName = boxname if port: if port != 80 and port != 443: