forked from indymedia/epicyon
Add muted field
parent
38c2a713ca
commit
c29dbe4dae
1
utils.py
1
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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue