From 534948b8fe1b5dd63cc6704185c34808ae2ddb09 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Sep 2019 21:43:18 +0100 Subject: [PATCH] Avoid clashing replies path --- daemon.py | 12 ++++++------ person.py | 4 ++-- posts.py | 12 ++++++------ webinterface.py | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/daemon.py b/daemon.py index d7a6818cc..31b049d97 100644 --- a/daemon.py +++ b/daemon.py @@ -1772,7 +1772,7 @@ class PubServer(BaseHTTPRequestHandler): return # get the replies for a given person - if self.path.endswith('/replies') or '/replies?page=' in self.path: + if self.path.endswith('/tlreplies') or '/tlreplies?page=' in self.path: if '/users/' in self.path: if authorized: inboxRepliesFeed= \ @@ -1781,11 +1781,11 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, \ self.path, \ self.server.httpPrefix, \ - maxPostsInFeed, 'replies', \ + maxPostsInFeed, 'tlreplies', \ True,self.server.ocapAlways) if inboxRepliesFeed: if self._requestHTTP(): - nickname=self.path.replace('/users/','').replace('/replies','') + nickname=self.path.replace('/users/','').replace('/tlreplies','') pageNumber=1 if '?page=' in nickname: pageNumber=nickname.split('?page=')[1] @@ -1802,7 +1802,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, \ self.path+'?page=1', \ self.server.httpPrefix, \ - maxPostsInFeed, 'replies', \ + maxPostsInFeed, 'tlreplies', \ True,self.server.ocapAlways) msg=htmlInboxReplies(self.server.translate, \ pageNumber,maxPostsInFeed, \ @@ -1827,10 +1827,10 @@ class PubServer(BaseHTTPRequestHandler): return else: if self.server.debug: - nickname=self.path.replace('/users/','').replace('/replies','') + nickname=self.path.replace('/users/','').replace('/tlreplies','') print('DEBUG: '+nickname+ \ ' was not authorized to access '+self.path) - if self.path!='/replies': + if self.path!='/tlreplies': # not the replies inbox if self.server.debug: print('DEBUG: GET access to inbox is unauthorized') diff --git a/person.py b/person.py index 46d1944f6..3b2781c60 100644 --- a/person.py +++ b/person.py @@ -401,7 +401,7 @@ def personBoxJson(baseDir: str,domain: str,port: int,path: str, \ """Obtain the inbox/outbox/moderation feed for the given person """ if boxname!='inbox' and boxname!='dm' and \ - boxname!='replies' and \ + boxname!='tlreplies' and \ boxname!='outbox' and boxname!='moderation': return None @@ -442,7 +442,7 @@ def personBoxJson(baseDir: str,domain: str,port: int,path: str, \ if boxname=='dm': return createDMTimeline(baseDir,nickname,domain,port,httpPrefix, \ noOfItems,headerOnly,ocapAlways,pageNumber) - elif boxname=='replies': + elif boxname=='tlreplies': return createRepliesTimeline(baseDir,nickname,domain,port,httpPrefix, \ noOfItems,headerOnly,ocapAlways,pageNumber) elif boxname=='outbox': diff --git a/posts.py b/posts.py index 215b3a64c..f9e131315 100644 --- a/posts.py +++ b/posts.py @@ -1581,7 +1581,7 @@ def createDMTimeline(baseDir: str,nickname: str,domain: str,port: int,httpPrefix def createRepliesTimeline(baseDir: str,nickname: str,domain: str,port: int,httpPrefix: str, \ itemsPerPage: int,headerOnly: bool,ocapAlways: bool,pageNumber=None) -> {}: - return createBoxBase(baseDir,'replies',nickname,domain,port,httpPrefix, \ + return createBoxBase(baseDir,'tlreplies',nickname,domain,port,httpPrefix, \ itemsPerPage,headerOnly,True,ocapAlways,pageNumber) def createOutbox(baseDir: str,nickname: str,domain: str,port: int,httpPrefix: str, \ @@ -1708,10 +1708,10 @@ def createBoxBase(baseDir: str,boxname: str, \ """ if boxname!='inbox' and boxname!='dm' and boxname!='outbox': return None - if boxname!='dm' and boxname!='replies': + if boxname!='dm' and boxname!='tlreplies': boxDir = createPersonDir(nickname,domain,baseDir,boxname) else: - # extract DMs from the inbox + # extract DMs or replies from the inbox boxDir = createPersonDir(nickname,domain,baseDir,'inbox') sharedBoxDir=None if boxname=='inbox': @@ -1852,7 +1852,7 @@ def createBoxBase(baseDir: str,boxname: str, \ if boxname=='dm': if '#Public' in postStr or '/followers' in postStr: isPost=False - elif boxname=='replies': + elif boxname=='tlreplies': if boxActor not in postStr: isPost=False @@ -1862,13 +1862,13 @@ def createBoxBase(baseDir: str,boxname: str, \ p = json.loads(postStr) isTimelinePost=False - if (boxname!='dm' and boxname!='replies'): + if (boxname!='dm' and boxname!='tlreplies'): isTimelinePost=True else: if boxname=='dm': if isDM(p): isTimelinePost=True - elif boxname=='replies': + elif boxname=='tlreplies': if isDM(p) or isReply(p,boxActor): isTimelinePost=True diff --git a/webinterface.py b/webinterface.py index d435bf570..baaba14b3 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2083,7 +2083,7 @@ def htmlTimeline(translate: {},pageNumber: int, \ inboxButton='buttonselected' elif boxName=='dm': dmButton='buttonselected' - elif boxName=='replies': + elif boxName=='tlreplies': repliesButton='buttonselected' elif boxName=='outbox': sentButton='buttonselected' @@ -2217,7 +2217,7 @@ def htmlInboxReplies(translate: {},pageNumber: int,itemsPerPage: int, \ """ return htmlTimeline(translate,pageNumber, \ itemsPerPage,session,baseDir,wfRequest,personCache, \ - nickname,domain,port,inboxJson,'replies',allowDeletion, \ + nickname,domain,port,inboxJson,'tlreplies',allowDeletion, \ httpPrefix,projectVersion,False) def htmlModeration(translate: {},pageNumber: int,itemsPerPage: int, \