From 5826b6f22a3816bc7c1ed06794384266f411aaa2 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 13 Jul 2017 13:41:17 +0100 Subject: [PATCH] Instead of sending HTML for any Entity, only send HTML for Links Otherwise emoji messages are sent as HTML, needlessly --- src/components/views/rooms/MessageComposerInput.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 9886f8623f..c0cc937e24 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -620,12 +620,13 @@ export default class MessageComposerInput extends React.Component { }); } if (!shouldSendHTML) { - const hasAnEntity = blocks.some((block) => { + const hasLink = blocks.some((block) => { return block.getCharacterList().filter((c) => { - return c.getEntity(); + const entityKey = c.getEntity(); + return entityKey && Entity.get(entityKey).getType() === 'LINK'; }).size > 0; }); - shouldSendHTML = hasAnEntity; + shouldSendHTML = hasLink; } if (shouldSendHTML) { contentHTML = HtmlUtils.processHtmlForSending(