From 267d44b5a41c9d3fc6930b530fa80e3d10cc7385 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Aug 2019 14:55:17 +0100 Subject: [PATCH] Persist link to post --- daemon.py | 1 + webinterface.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 58b3c389..fd7da55e 100644 --- a/daemon.py +++ b/daemon.py @@ -950,6 +950,7 @@ class PubServer(BaseHTTPRequestHandler): self.path.endswith('/newfollowers') or \ self.path.endswith('/newdm') or \ self.path.endswith('/newreport') or \ + '/newreport?=' in self.path or \ self.path.endswith('/newshare')): self._set_headers('text/html',cookie) self.wfile.write(htmlNewPost(self.server.baseDir,self.path,inReplyToUrl,replyToList).encode()) diff --git a/webinterface.py b/webinterface.py index 2469e241..cc7a9067 100644 --- a/webinterface.py +++ b/webinterface.py @@ -317,6 +317,10 @@ def htmlTermsOfService(baseDir: str,httpPrefix: str,domainFull: str) -> str: return TOSForm def htmlNewPost(baseDir: str,path: str,inReplyTo: str,mentions: []) -> str: + reportUrl=None + if '/newreport?=' in path: + reportUrl=path.split('/newreport?=')[1] + path=path.split('/newreport?=')[0] replyStr='' if not path.endswith('/newshare'): if not path.endswith('/newreport'): @@ -397,6 +401,13 @@ def htmlNewPost(baseDir: str,path: str,inReplyTo: str,mentions: []) -> str: else: mentionsStr+='@'+mentionNickname+'@'+mentionDomain+' ' + reportOptionOnDropdown='Report
Send to moderators
' + + # For moderation reports add a link to the post reported + if reportUrl: + mentionStr='Reported link: '+reportUrl+'\n\n' + reportOptionOnDropdown='Report
Send to moderators
' + newPostForm+= \ '
' \ '
' \ @@ -408,9 +419,8 @@ def htmlNewPost(baseDir: str,path: str,inReplyTo: str,mentions: []) -> str: ' Public
Visible to anyone
' \ ' Unlisted
Not on public timeline
' \ ' Followers Only
Only to followers
' \ - ' Direct Message
Only to mentioned people
' \ - ' Report
Send to moderators
'+ \ - shareOptionOnDropdown+ \ + ' Direct Message
Only to mentioned people
'+ \ + reportOptionOnDropdown+shareOptionOnDropdown+ \ '
' \ ' ' \ ' ' \ @@ -842,7 +852,7 @@ def individualPostAsHtml(baseDir: str, \ reportStr='' if messageId: - reportStr='Report' + reportStr='Report' avatarDropdown= \ '