diff --git a/reaction.py b/reaction.py index ab42b71f3..92485804d 100644 --- a/reaction.py +++ b/reaction.py @@ -517,6 +517,7 @@ def htmlEmojiReactions(postJsonObject: {}, interactive: bool, actor: str, maxReactionTypes: int, boxName: str, pageNumber: int) -> str: """html containing row of emoji reactions + displayed at the bottom of posts, above the icons """ if not hasObjectDict(postJsonObject): return '' @@ -531,19 +532,37 @@ def htmlEmojiReactions(postJsonObject: {}, interactive: bool, for item in postJsonObject['object']['reactions']['items']: emojiContent = item['content'] emojiActor = item['actor'] + emojiNickname = getNicknameFromActor(emojiActor) + emojiDomain, _ = getDomainFromActor(emojiActor) + emojiHandle = emojiNickname + '@' + emojiDomain if emojiActor == actor: if emojiContent not in reactedToByThisActor: reactedToByThisActor.append(emojiContent) if not reactions.get(emojiContent): if len(reactions.items()) < maxReactionTypes: - reactions[emojiContent] = 1 + reactions[emojiContent] = { + "handles": [emojiHandle], + "count": 1 + } else: - reactions[emojiContent] += 1 + reactions[emojiContent]['count'] += 1 + if len(reactions[emojiContent]['handles']) < 32: + reactions[emojiContent]['handles'].append(emojiHandle) if len(reactions.items()) == 0: return '' reactBy = removeIdEnding(postJsonObject['object']['id']) htmlStr = '