Remove state change check

main
Bob Mottram 2021-09-28 15:15:04 +01:00
parent 5dc3e11374
commit 0766e8b1d6
1 changed files with 2 additions and 22 deletions

View File

@ -1180,24 +1180,6 @@ def _getFooterWithIcons(showIcons: bool,
return footerStr return footerStr
def _htmlMutedStateChanged(postJsonObject: {}, postHtml: str) -> bool:
"""Returns true if the muted status of a post is different between the
json and the html
"""
postJsonObj = postJsonObject
if hasObjectDict(postJsonObject):
postJsonObj = postJsonObject['object']
if 'muted' not in postJsonObj:
return False
if postJsonObj['muted'] is False:
if '?unmute=' in postHtml:
return True
else:
if '?mute=' in postHtml:
return True
return False
def individualPostAsHtml(signingPrivateKeyPem: str, def individualPostAsHtml(signingPrivateKeyPem: str,
allowDownloads: bool, allowDownloads: bool,
recentPostsCache: {}, maxRecentPosts: int, recentPostsCache: {}, maxRecentPosts: int,
@ -1279,8 +1261,7 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
maxRecentPosts, maxRecentPosts,
signingPrivateKeyPem) signingPrivateKeyPem)
if postHtml: if postHtml:
if not _htmlMutedStateChanged(postJsonObject, postHtml): return postHtml
return postHtml
if useCacheOnly and postJsonObject['type'] != 'Announce': if useCacheOnly and postJsonObject['type'] != 'Announce':
return '' return ''
@ -1408,8 +1389,7 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
maxRecentPosts, maxRecentPosts,
signingPrivateKeyPem) signingPrivateKeyPem)
if postHtml: if postHtml:
if not _htmlMutedStateChanged(postJsonObject, postHtml): return postHtml
return postHtml
announceFilename = \ announceFilename = \
locatePost(baseDir, nickname, domain, postJsonObject['id']) locatePost(baseDir, nickname, domain, postJsonObject['id'])