From 2a8f9a81f7cc78affb853209e7800040f7271e1d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 5 Jul 2019 15:18:53 +0100 Subject: [PATCH] Allow diplayed reaction values to contain anything Part of https://github.com/vector-im/riot-web/issues/10256 --- src/HtmlUtils.js | 11 +---------- src/components/views/messages/ReactionsRow.js | 4 ---- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 73ab28e65c..fb7a14d6fb 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -66,19 +66,10 @@ const VARIATION_SELECTOR = String.fromCharCode(0xFE0F); * need emojification. * unicodeToImage uses this function. */ -export function mightContainEmoji(str) { +function mightContainEmoji(str) { return SURROGATE_PAIR_PATTERN.test(str) || SYMBOL_PATTERN.test(str); } -/** - * Returns true if the string definitely contains a single emoji. - * @param {String} str String to test - * @return {Boolean} - */ -export function isSingleEmoji(str) { - return mightContainEmoji(str) && SINGLE_EMOJI_REGEX.test(str); -} - /** * Returns the shortcode for an emoji character. * diff --git a/src/components/views/messages/ReactionsRow.js b/src/components/views/messages/ReactionsRow.js index 57d2afc429..0abb1015b9 100644 --- a/src/components/views/messages/ReactionsRow.js +++ b/src/components/views/messages/ReactionsRow.js @@ -20,7 +20,6 @@ import PropTypes from 'prop-types'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { isContentActionable } from '../../../utils/EventUtils'; -import { isSingleEmoji } from '../../../HtmlUtils'; import MatrixClientPeg from '../../../MatrixClientPeg'; // The maximum number of reactions to initially show on a message. @@ -115,9 +114,6 @@ export default class ReactionsRow extends React.PureComponent { const ReactionsRowButton = sdk.getComponent('messages.ReactionsRowButton'); let items = reactions.getSortedAnnotationsByKey().map(([content, events]) => { - if (!isSingleEmoji(content)) { - return null; - } const count = events.size; if (!count) { return null;