From c29dbe4dae512e520d7ef4826cafdd50592846c5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 1 Dec 2019 16:15:41 +0000 Subject: [PATCH] Add muted field --- utils.py | 1 + webinterface.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 44dce8ad..50bd7f5e 100644 --- a/utils.py +++ b/utils.py @@ -509,6 +509,7 @@ def updateRecentPostsCache(recentPostsCache: {},maxRecentPosts: int, \ if postId in recentPostsCache['index']: return recentPostsCache['index'].append(postId) + postJsonObject['muted']=False recentPostsCache['json'][postId]=json.dumps(postJsonObject) recentPostsCache['html'][postId]=htmlStr diff --git a/webinterface.py b/webinterface.py index 89ebd2b8..d897fba3 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1998,8 +1998,9 @@ def preparePostFromHtmlCache(postHtml: str,boxName: str,pageNumber: int) -> str: def postIsMuted(baseDir: str,nickname: str,domain: str, postJsonObject: {},messageId: str) -> bool: """ Returns true if the given post is muted """ - if postJsonObject.get('muted'): - return True + isMuted=postJsonObject.get('muted') + if isMuted==True or isMuted==False: + return isMuted postDir=baseDir+'/accounts/'+nickname+'@'+domain muteFilename=postDir+'/inbox/'+messageId.replace('/','#')+'.json.muted' if os.path.isfile(muteFilename):