Restrict reactions to a single emoji
While the protocol supports more complex strings, in Riot we only want to display single emoji. Fixes https://github.com/vector-im/riot-web/issues/9916
This commit is contained in:
parent
97019fbfb5
commit
5581b56cfe
2 changed files with 16 additions and 2 deletions
|
@ -19,6 +19,7 @@ import PropTypes from 'prop-types';
|
|||
|
||||
import sdk from '../../../index';
|
||||
import { isContentActionable } from '../../../utils/EventUtils';
|
||||
import { isSingleEmoji } from '../../../HtmlUtils';
|
||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||
|
||||
export default class ReactionsRow extends React.PureComponent {
|
||||
|
@ -103,6 +104,9 @@ export default class ReactionsRow extends React.PureComponent {
|
|||
|
||||
const ReactionsRowButton = sdk.getComponent('messages.ReactionsRowButton');
|
||||
const items = reactions.getSortedAnnotationsByKey().map(([content, events]) => {
|
||||
if (!isSingleEmoji(content)) {
|
||||
return null;
|
||||
}
|
||||
const count = events.size;
|
||||
if (!count) {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue