From 348df00736c8fef89b7449a19e25742784c32642 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 25 Aug 2019 18:34:09 +0100 Subject: [PATCH] DM timeline --- daemon.py | 37 +++++++++++++++++++------------------ webinterface.py | 11 +++++++++++ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/daemon.py b/daemon.py index 6ff0da919..d14fb4772 100644 --- a/daemon.py +++ b/daemon.py @@ -76,6 +76,7 @@ from roles import setRole from roles import clearModeratorStatus from skills import outboxSkills from availability import outboxAvailability +from webinterface import htmlInboxDMs from webinterface import htmlUnblockConfirm from webinterface import htmlPersonOptions from webinterface import htmlIndividualPost @@ -1383,12 +1384,12 @@ class PubServer(BaseHTTPRequestHandler): if '/users/' in self.path: if authorized: inboxDMFeed=personBoxJson(self.server.baseDir, \ - self.server.domain, \ - self.server.port, \ - self.path, \ - self.server.httpPrefix, \ - maxPostsInFeed, 'dm', \ - True,self.server.ocapAlways) + self.server.domain, \ + self.server.port, \ + self.path, \ + self.server.httpPrefix, \ + maxPostsInFeed, 'dm', \ + True,self.server.ocapAlways) if inboxDMFeed: if self._requestHTTP(): nickname=self.path.replace('/users/','').replace('/dm','') @@ -1409,18 +1410,18 @@ class PubServer(BaseHTTPRequestHandler): self.server.httpPrefix, \ maxPostsInFeed, 'dm', \ True,self.server.ocapAlways) - msg=htmlInbox(pageNumber,maxPostsInFeed, \ - self.server.session, \ - self.server.baseDir, \ - self.server.cachedWebfingers, \ - self.server.personCache, \ - nickname, \ - self.server.domain, \ - self.server.port, \ - inboxDMFeed, \ - self.server.allowDeletion, \ - self.server.httpPrefix, \ - self.server.projectVersion).encode('utf-8') + msg=htmlInboxDMs(pageNumber,maxPostsInFeed, \ + self.server.session, \ + self.server.baseDir, \ + self.server.cachedWebfingers, \ + self.server.personCache, \ + nickname, \ + self.server.domain, \ + self.server.port, \ + inboxDMFeed, \ + self.server.allowDeletion, \ + self.server.httpPrefix, \ + self.server.projectVersion).encode('utf-8') self._set_headers('text/html',len(msg),cookie) self.wfile.write(msg) else: diff --git a/webinterface.py b/webinterface.py index 3c359331f..0db3958e1 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1467,6 +1467,17 @@ def htmlInbox(pageNumber: int,itemsPerPage: int, \ nickname,domain,port,inboxJson,'inbox',allowDeletion, \ httpPrefix,projectVersion) +def htmlInboxDMs(pageNumber: int,itemsPerPage: int, \ + session,baseDir: str,wfRequest: {},personCache: {}, \ + nickname: str,domain: str,port: int,inboxJson: {}, \ + allowDeletion: bool, \ + httpPrefix: str,projectVersion: str) -> str: + """Show the DM timeline as html + """ + return htmlTimeline(pageNumber,itemsPerPage,session,baseDir,wfRequest,personCache, \ + nickname,domain,port,inboxJson,'dm',allowDeletion, \ + httpPrefix,projectVersion) + def htmlModeration(pageNumber: int,itemsPerPage: int, \ session,baseDir: str,wfRequest: {},personCache: {}, \ nickname: str,domain: str,port: int,inboxJson: {}, \