Remove duplication

main
Bob Mottram 2021-09-27 20:42:50 +01:00
parent a15e905052
commit 1328063a95
1 changed files with 6 additions and 10 deletions

View File

@ -532,13 +532,11 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['json'].get(postId):
postJsonObject['muted'] = True
recentPostsCache['json'][postId] = json.dumps(postJsonObject)
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
print('MUTE: ' + postId +
' marked as muted in recent posts memory cache')
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
@ -610,13 +608,11 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['json'].get(postId):
postJsonObject['muted'] = False
recentPostsCache['json'][postId] = json.dumps(postJsonObject)
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
print('UNMUTE: ' + postId +
' marked as unmuted in recent posts cache')
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
def outboxMute(baseDir: str, httpPrefix: str,