diff --git a/bigbluebutton-html5/imports/ui/components/chat/message-form/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/message-form/component.jsx index b0db2da66446a705cd6e21f6d98bc3d732c6d9ff..80d83b86e8eee59954cf95ae897ba26ba91b9c19 100755 --- a/bigbluebutton-html5/imports/ui/components/chat/message-form/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/message-form/component.jsx @@ -68,7 +68,8 @@ const messages = defineMessages({ }, }); -const CHAT_ENABLED = Meteor.settings.public.chat.enabled; +const CHAT_CONFIG = Meteor.settings.public.chat; +const CHAT_ENABLED = CHAT_CONFIG.enabled; class MessageForm extends PureComponent { constructor(props) { @@ -87,6 +88,7 @@ class MessageForm extends PureComponent { this.handleSubmit = this.handleSubmit.bind(this); this.setMessageHint = this.setMessageHint.bind(this); this.handleUserTyping = _.throttle(this.handleUserTyping.bind(this), 2000, { trailing: false }); + this.typingIndicator = CHAT_CONFIG.typingIndicator.enabled; } componentDidMount() { @@ -197,7 +199,7 @@ class MessageForm extends PureComponent { handleUserTyping(error) { const { startUserTyping, chatId } = this.props; - if (error) return; + if (error || !this.typingIndicator) return; startUserTyping(chatId); } @@ -250,12 +252,14 @@ class MessageForm extends PureComponent { div.appendChild(document.createTextNode(msg)); msg = div.innerHTML; + const callback = this.typingIndicator ? stopUserTyping : null; + return ( handleSendMessage(msg), this.setState({ message: '', hasErrors: false, - }, stopUserTyping) + }, callback) ); }