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']:
|
if postId in recentPostsCache['index']:
|
||||||
return
|
return
|
||||||
recentPostsCache['index'].append(postId)
|
recentPostsCache['index'].append(postId)
|
||||||
|
postJsonObject['muted']=False
|
||||||
recentPostsCache['json'][postId]=json.dumps(postJsonObject)
|
recentPostsCache['json'][postId]=json.dumps(postJsonObject)
|
||||||
recentPostsCache['html'][postId]=htmlStr
|
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:
|
def postIsMuted(baseDir: str,nickname: str,domain: str, postJsonObject: {},messageId: str) -> bool:
|
||||||
""" Returns true if the given post is muted
|
""" Returns true if the given post is muted
|
||||||
"""
|
"""
|
||||||
if postJsonObject.get('muted'):
|
isMuted=postJsonObject.get('muted')
|
||||||
return True
|
if isMuted==True or isMuted==False:
|
||||||
|
return isMuted
|
||||||
postDir=baseDir+'/accounts/'+nickname+'@'+domain
|
postDir=baseDir+'/accounts/'+nickname+'@'+domain
|
||||||
muteFilename=postDir+'/inbox/'+messageId.replace('/','#')+'.json.muted'
|
muteFilename=postDir+'/inbox/'+messageId.replace('/','#')+'.json.muted'
|
||||||
if os.path.isfile(muteFilename):
|
if os.path.isfile(muteFilename):
|
||||||
|
|
Loading…
Reference in New Issue