Extra options on reaction emoji links

main
Bob Mottram 2021-11-12 11:40:27 +00:00
parent 64e58fc365
commit 1281596208
2 changed files with 12 additions and 4 deletions

View File

@ -514,11 +514,14 @@ def updateReactionCollection(recentPostsCache: {},
def htmlEmojiReactions(postJsonObject: {}, interactive: bool,
actor: str, maxReactionTypes: int) -> str:
actor: str, maxReactionTypes: int,
boxName: str, pageNumber: int) -> str:
"""html containing row of emoji reactions
"""
if not hasObjectDict(postJsonObject):
return ''
if not postJsonObject.get('actor'):
return ''
if not postJsonObject['object'].get('reactions'):
return ''
if not postJsonObject['object']['reactions'].get('items'):
@ -542,9 +545,13 @@ def htmlEmojiReactions(postJsonObject: {}, interactive: bool,
htmlStr = '<div class="emojiReactionBar">\n'
for emojiContent, count in reactions.items():
if emojiContent not in reactedToByThisActor:
baseUrl = actor + '?react=' + reactBy + '?emojreact='
baseUrl = actor + '?react=' + reactBy
else:
baseUrl = actor + '?unreact=' + reactBy + '?emojreact='
baseUrl = actor + '?unreact=' + reactBy
baseUrl += '?actor=' + postJsonObject['actor']
baseUrl += '?tl=' + boxName
baseUrl += '?page=' + str(pageNumber)
baseUrl += '?emojreact='
htmlStr += ' <div class="emojiReactionButton">\n'
if count < 100:

View File

@ -1937,7 +1937,8 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
if showIcons:
reactionStr = \
htmlEmojiReactions(postJsonObject, True, personUrl,
maxReactionTypes)
maxReactionTypes,
boxName, pageNumber)
if postIsSensitive and reactionStr:
reactionStr = '<br>' + reactionStr
postHtml = ' <div id="' + timelinePostBookmark + \