From 087712addd04195d658c50e44c186bad9f58b6f2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 1 Dec 2019 15:28:23 +0000 Subject: [PATCH] Bookmarked mute button --- daemon.py | 16 ++++++++++++++-- webinterface.py | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 39a667c86..67a33d587 100644 --- a/daemon.py +++ b/daemon.py @@ -2117,6 +2117,12 @@ class PubServer(BaseHTTPRequestHandler): muteUrl=self.path.split('?mute=')[1] if '?' in muteUrl: muteUrl=muteUrl.split('?')[0] + timelineBookmark='' + if '?bm=' in self.path: + timelineBookmark=self.path.split('?bm=')[1] + if '?' in timelineBookmark: + timelineBookmark=timelineBookmark.split('?')[0] + timelineBookmark='#'+timelineBookmark timelineStr=self.server.defaultTimeline if '?tl=' in self.path: timelineStr=self.path.split('?tl=')[1] @@ -2129,7 +2135,7 @@ class PubServer(BaseHTTPRequestHandler): mutePost(self.server.baseDir,nickname,self.server.domain, \ muteUrl,self.server.recentPostsCache) self.server.GETbusy=False - self._redirect_headers(actor+'/'+timelineStr,cookie) + self._redirect_headers(actor+'/'+timelineStr+timelineBookmark,cookie) return # unmute a post from the web interface icon @@ -2144,6 +2150,12 @@ class PubServer(BaseHTTPRequestHandler): muteUrl=self.path.split('?unmute=')[1] if '?' in muteUrl: muteUrl=muteUrl.split('?')[0] + timelineBookmark='' + if '?bm=' in self.path: + timelineBookmark=self.path.split('?bm=')[1] + if '?' in timelineBookmark: + timelineBookmark=timelineBookmark.split('?')[0] + timelineBookmark='#'+timelineBookmark timelineStr=self.server.defaultTimeline if '?tl=' in self.path: timelineStr=self.path.split('?tl=')[1] @@ -2156,7 +2168,7 @@ class PubServer(BaseHTTPRequestHandler): unmutePost(self.server.baseDir,nickname,self.server.domain, \ muteUrl,self.server.recentPostsCache) self.server.GETbusy=False - self._redirect_headers(actor+'/'+timelineStr,cookie) + self._redirect_headers(actor+'/'+timelineStr+timelineBookmark,cookie) return # reply from the web interface icon diff --git a/webinterface.py b/webinterface.py index 5979f8c3e..031dc2054 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2267,10 +2267,10 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ deleteStr+=''+translate['Delete this post']+'' else: if not isMuted: - muteStr='' + muteStr='' muteStr+=''+translate['Mute this post']+'' else: - muteStr='' + muteStr='' muteStr+=''+translate['Undo mute']+'' replyAvatarImageInPost=''