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

Commit

Permalink
Allow diplayed reaction values to contain anything
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Jul 5, 2019
1 parent 27c79b9 commit 2a8f9a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
11 changes: 1 addition & 10 deletions src/HtmlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
4 changes: 0 additions & 4 deletions src/components/views/messages/ReactionsRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2a8f9a8

Please sign in to comment.