Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a1e9686

Browse files
tulirsumnerevans
authored andcommitted
Include custom reaction short names in tooltips
1 parent 7de2330 commit a1e9686

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/views/messages/ReactionsRowButtonTooltip.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ interface IProps {
3232
visible: boolean;
3333
}
3434

35+
const getCustomReactionName = (reactionEvents: Set<MatrixEvent>) => {
36+
for (const event of reactionEvents) {
37+
if (event.event.content?.["com.beeper.reaction.shortcode"]) {
38+
return event.event.content?.["com.beeper.reaction.shortcode"];
39+
}
40+
}
41+
42+
return '';
43+
};
44+
3545
export default class ReactionsRowButtonTooltip extends React.PureComponent<IProps> {
3646
public static contextType = MatrixClientContext;
3747
public context!: React.ContextType<typeof MatrixClientContext>;
@@ -48,7 +58,7 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent<IProp
4858
const name = member?.name ?? reactionEvent.getSender()!;
4959
senders.push(name);
5060
}
51-
const shortName = unicodeToShortcode(content);
61+
const shortName = unicodeToShortcode(content) || getCustomReactionName(reactionEvents);
5262
tooltipLabel = (
5363
<div>
5464
{_t(

0 commit comments

Comments
 (0)