diff --git a/config.js b/config.js index 889f04113b..0da882750b 100644 --- a/config.js +++ b/config.js @@ -1017,6 +1017,9 @@ var config = { // Prevent the filmstrip from autohiding when screen width is under a certain threshold // disableFilmstripAutohiding: false, + // Specifies whether the chat emoticons are disabled or not + // disableChatSmileys: false, + // Allow all above example options to include a trailing comma and // prevent fear when commenting out the last value. makeJsonParserHappy: 'even if last key had a trailing comma' diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index bf8fce2486..201de910fe 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -83,6 +83,7 @@ export default [ 'disableAGC', 'disableAP', 'disableAudioLevels', + 'disableChatSmileys', 'disableDeepLinking', 'disabledSounds', 'disableFilmstripAutohiding', diff --git a/react/features/chat/components/web/ChatInput.js b/react/features/chat/components/web/ChatInput.js index 2678aeda5c..d2d436d9dc 100644 --- a/react/features/chat/components/web/ChatInput.js +++ b/react/features/chat/components/web/ChatInput.js @@ -8,6 +8,7 @@ import { isMobileBrowser } from '../../../base/environment/utils'; import { translate } from '../../../base/i18n'; import { Icon, IconPlane, IconSmile } from '../../../base/icons'; import { connect } from '../../../base/redux'; +import { areSmileysDisabled } from '../../functions'; import SmileysPanel from './SmileysPanel'; @@ -35,7 +36,13 @@ type Props = { /** * Invoked to obtain translated strings. */ - t: Function + t: Function, + + /** + * Whether chat emoticons are disabled. + */ + _areSmileysDisabled: boolean + }; /** @@ -115,28 +122,31 @@ class ChatInput extends Component { return (
-
-
-
-
- + { this.props._areSmileysDisabled ? null : ( +
+
+
+
+ +
+
+ +
-
- -
-
+ ) }
{ } } -export default translate(connect()(ChatInput)); +/** + * Function that maps parts of Redux state tree into component props. + * + * @param {Object} state - Redux state. + * @private + * @returns {{ + * _areSmileysDisabled: boolean + * }} + */ +const mapStateToProps = state => { + return { + _areSmileysDisabled: areSmileysDisabled(state) + }; +}; + +export default translate(connect(mapStateToProps)(ChatInput)); diff --git a/react/features/chat/functions.js b/react/features/chat/functions.js index 724c2faa6c..24d04a236c 100644 --- a/react/features/chat/functions.js +++ b/react/features/chat/functions.js @@ -90,3 +90,15 @@ export function getUnreadMessagesCount(state: Object) { return nbUnreadMessages; } + +/** + * Get whether the chat smileys are disabled or not. + * + * @param {Object} state - The redux state. + * @returns {boolean} The disabled flag. + */ +export function areSmileysDisabled(state: Object) { + const disableChatSmileys = state['features/base/config']?.disableChatSmileys === true; + + return disableChatSmileys; +}