fix: remove unnecessary escaping

This commit is contained in:
Bettenbuk Zoltan 2019-10-07 14:39:39 +02:00 committed by Zoltan Bettenbuk
parent ab4b6be9d7
commit f270b50972
2 changed files with 3 additions and 13 deletions

View File

@ -30,16 +30,10 @@ class ChatMessage extends AbstractChatMessage<Props> {
})
: message.message;
// replace links and smileys
// Strophe already escapes special symbols on sending,
// so we escape here only tags to avoid double &amp;
const escMessage = messageToDisplay.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/\n/g, '<br/>');
const processedMessage = [];
// content is an array of text and emoji components
const content = toArray(escMessage, { className: 'smiley' });
const content = toArray(messageToDisplay, { className: 'smiley' });
content.forEach(i => {
if (typeof i === 'string') {

View File

@ -1,7 +1,5 @@
// @flow
import UIUtil from '../../../modules/UI/util/UIUtil';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
import {
CONFERENCE_JOINED,
@ -49,12 +47,10 @@ MiddlewareRegistry.register(store => next => action => {
const { conference } = store.getState()['features/base/conference'];
if (conference) {
const escapedMessage = UIUtil.escapeHtml(action.message);
if (typeof APP !== 'undefined') {
APP.API.notifySendingChatMessage(escapedMessage);
APP.API.notifySendingChatMessage(action.message);
}
conference.sendTextMessage(escapedMessage);
conference.sendTextMessage(action.message);
}
break;
}