DM timeline

master
Bob Mottram 2019-08-25 18:34:09 +01:00
parent 88a320603b
commit 348df00736
2 changed files with 30 additions and 18 deletions

View File

@ -76,6 +76,7 @@ from roles import setRole
from roles import clearModeratorStatus from roles import clearModeratorStatus
from skills import outboxSkills from skills import outboxSkills
from availability import outboxAvailability from availability import outboxAvailability
from webinterface import htmlInboxDMs
from webinterface import htmlUnblockConfirm from webinterface import htmlUnblockConfirm
from webinterface import htmlPersonOptions from webinterface import htmlPersonOptions
from webinterface import htmlIndividualPost from webinterface import htmlIndividualPost
@ -1383,12 +1384,12 @@ class PubServer(BaseHTTPRequestHandler):
if '/users/' in self.path: if '/users/' in self.path:
if authorized: if authorized:
inboxDMFeed=personBoxJson(self.server.baseDir, \ inboxDMFeed=personBoxJson(self.server.baseDir, \
self.server.domain, \ self.server.domain, \
self.server.port, \ self.server.port, \
self.path, \ self.path, \
self.server.httpPrefix, \ self.server.httpPrefix, \
maxPostsInFeed, 'dm', \ maxPostsInFeed, 'dm', \
True,self.server.ocapAlways) True,self.server.ocapAlways)
if inboxDMFeed: if inboxDMFeed:
if self._requestHTTP(): if self._requestHTTP():
nickname=self.path.replace('/users/','').replace('/dm','') nickname=self.path.replace('/users/','').replace('/dm','')
@ -1409,18 +1410,18 @@ class PubServer(BaseHTTPRequestHandler):
self.server.httpPrefix, \ self.server.httpPrefix, \
maxPostsInFeed, 'dm', \ maxPostsInFeed, 'dm', \
True,self.server.ocapAlways) True,self.server.ocapAlways)
msg=htmlInbox(pageNumber,maxPostsInFeed, \ msg=htmlInboxDMs(pageNumber,maxPostsInFeed, \
self.server.session, \ self.server.session, \
self.server.baseDir, \ self.server.baseDir, \
self.server.cachedWebfingers, \ self.server.cachedWebfingers, \
self.server.personCache, \ self.server.personCache, \
nickname, \ nickname, \
self.server.domain, \ self.server.domain, \
self.server.port, \ self.server.port, \
inboxDMFeed, \ inboxDMFeed, \
self.server.allowDeletion, \ self.server.allowDeletion, \
self.server.httpPrefix, \ self.server.httpPrefix, \
self.server.projectVersion).encode('utf-8') self.server.projectVersion).encode('utf-8')
self._set_headers('text/html',len(msg),cookie) self._set_headers('text/html',len(msg),cookie)
self.wfile.write(msg) self.wfile.write(msg)
else: else:

View File

@ -1467,6 +1467,17 @@ def htmlInbox(pageNumber: int,itemsPerPage: int, \
nickname,domain,port,inboxJson,'inbox',allowDeletion, \ nickname,domain,port,inboxJson,'inbox',allowDeletion, \
httpPrefix,projectVersion) 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, \ def htmlModeration(pageNumber: int,itemsPerPage: int, \
session,baseDir: str,wfRequest: {},personCache: {}, \ session,baseDir: str,wfRequest: {},personCache: {}, \
nickname: str,domain: str,port: int,inboxJson: {}, \ nickname: str,domain: str,port: int,inboxJson: {}, \