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

Commit 7de2330

Browse files
tulirsumnerevans
authored andcommitted
Add support for rendering custom emojis in reactions
1 parent 0ce3664 commit 7de2330

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/views/messages/ReactionsRowButton.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React from "react";
1818
import classNames from "classnames";
1919
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
2020

21+
import { MatrixClientPeg } from "../../../MatrixClientPeg";
2122
import { _t } from "../../../languageHandler";
2223
import { formatCommaSeparatedList } from "../../../utils/FormattingUtils";
2324
import dis from "../../../dispatcher/dispatcher";
@@ -130,9 +131,18 @@ export default class ReactionsRowButton extends React.PureComponent<IProps, ISta
130131
onMouseOver={this.onMouseOver}
131132
onMouseLeave={this.onMouseLeave}
132133
>
133-
<span className="mx_ReactionsRowButton_content" aria-hidden="true">
134-
{content}
135-
</span>
134+
{content.startsWith("mxc://") ? (
135+
<img
136+
className="mx_ReactionsRowButton_content"
137+
src={MatrixClientPeg.get().mxcUrlToHttp(content)}
138+
width="16"
139+
height="16"
140+
/>
141+
) : (
142+
<span className="mx_ReactionsRowButton_content" aria-hidden="true">
143+
{content}
144+
</span>
145+
)}
136146
<span className="mx_ReactionsRowButton_count" aria-hidden="true">
137147
{count}
138148
</span>

0 commit comments

Comments
 (0)