diff --git a/webapp_post.py b/webapp_post.py
index dcf42238..14947d45 100644
--- a/webapp_post.py
+++ b/webapp_post.py
@@ -497,6 +497,51 @@ def getBookmarkIconHtml(nickname: str, domainFull: str,
return bookmarkStr
+def getMuteIconHtml(isMuted: bool,
+ postActor: str,
+ messageId: str,
+ nickname: str, domainFull: str,
+ allowDeletion: bool,
+ pageNumberParam: str,
+ iconsPath: str,
+ boxName: str,
+ timelinePostBookmark: str,
+ translate: {}) -> str:
+ """Returns html for mute icon/button
+ """
+ muteStr = ''
+ if (allowDeletion or
+ ('/' + domainFull + '/' in postActor and
+ messageId.startswith(postActor))):
+ return muteStr
+
+ if not isMuted:
+ muteStr = \
+ ' \n'
+ muteStr += \
+ ' ' + \
+ '\n'
+ else:
+ muteStr = \
+ ' \n'
+ muteStr += \
+ ' ' + \
+ '\n'
+ return muteStr
+
+
def individualPostAsHtml(allowDownloads: bool,
recentPostsCache: {}, maxRecentPosts: int,
iconsPath: str, translate: {},
@@ -833,8 +878,19 @@ def individualPostAsHtml(allowDownloads: bool,
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 13 = ' + str(timeDiff))
+ muteStr = \
+ getMuteIconHtml(isMuted,
+ postActor,
+ messageId,
+ nickname, domainFull,
+ allowDeletion,
+ pageNumberParam,
+ iconsPath,
+ boxName,
+ timelinePostBookmark,
+ translate)
+
deleteStr = ''
- muteStr = ''
if (allowDeletion or
('/' + domainFull + '/' in postActor and
messageId.startswith(postActor))):
@@ -851,31 +907,6 @@ def individualPostAsHtml(allowDownloads: bool,
translate['Delete this post'] + \
' |" title="' + translate['Delete this post'] + \
'" src="/' + iconsPath + '/delete.png"/>\n'
- else:
- if not isMuted:
- muteStr = \
- ' \n'
- muteStr += \
- ' ' + \
- '\n'
- else:
- muteStr = \
- ' \n'
- muteStr += \
- ' ' + \
- '\n'
# benchmark 13.1
if enableTimingLog: