mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 10:27:06 +03:00
Instead of sending HTML for any Entity, only send HTML for Links
Otherwise emoji messages are sent as HTML, needlessly
This commit is contained in:
parent
be045a6dc0
commit
5826b6f22a
1 changed files with 4 additions and 3 deletions
|
@ -620,12 +620,13 @@ export default class MessageComposerInput extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!shouldSendHTML) {
|
if (!shouldSendHTML) {
|
||||||
const hasAnEntity = blocks.some((block) => {
|
const hasLink = blocks.some((block) => {
|
||||||
return block.getCharacterList().filter((c) => {
|
return block.getCharacterList().filter((c) => {
|
||||||
return c.getEntity();
|
const entityKey = c.getEntity();
|
||||||
|
return entityKey && Entity.get(entityKey).getType() === 'LINK';
|
||||||
}).size > 0;
|
}).size > 0;
|
||||||
});
|
});
|
||||||
shouldSendHTML = hasAnEntity;
|
shouldSendHTML = hasLink;
|
||||||
}
|
}
|
||||||
if (shouldSendHTML) {
|
if (shouldSendHTML) {
|
||||||
contentHTML = HtmlUtils.processHtmlForSending(
|
contentHTML = HtmlUtils.processHtmlForSending(
|
||||||
|
|
Loading…
Reference in a new issue