Disallow sending of empty messages

pull/21833/head
Michael Telatynski 2020-11-03 16:06:45 +00:00
parent 6a916757df
commit cfb9d0f2d4
1 changed files with 3 additions and 0 deletions

View File

@ -308,6 +308,9 @@ export default class SendMessageComposer extends React.Component {
const startTime = CountlyAnalytics.getTimestamp(); const startTime = CountlyAnalytics.getTimestamp();
const {roomId} = this.props.room; const {roomId} = this.props.room;
const content = createMessageContent(this.model, this.props.permalinkCreator, replyToEvent); const content = createMessageContent(this.model, this.props.permalinkCreator, replyToEvent);
// don't bother sending an empty message
if (!content.body.trim()) return;
const prom = this.context.sendMessage(roomId, content); const prom = this.context.sendMessage(roomId, content);
if (replyToEvent) { if (replyToEvent) {
// Clear reply_to_event as we put the message into the queue // Clear reply_to_event as we put the message into the queue