async function updateMessageModel(val, dispatchAction = false, forceUpdate = false) {
                if (scope.message.MIMEType === PLAINTEXT) {
                    if (forceUpdate) {
                        // The plaintext editor uses the message model so use $applyAsync
                        scope.$applyAsync(() => {
                            scope.message.setDecryptedBody(val, false);
                            // Dispatch an event to update the message
                            dispatchAction && dispatcher.message('updated', { message: scope.message });
                        });
                    }
                    return;
                }
                // Sanitize the message with the DOMPurify config.
                const value = sanitize.message(val || '');
                // Replace the embedded images with CID to keep the model updated
                const body = await embedded.parser(scope.message, { direction: 'cid', text: value });
                // Update the model (note that this does not change anything in the squire editor so $applyAsync should not be needed)
                scope.message.setDecryptedBody(body);
                // Dispatch an event to update the message
                dispatchAction && dispatcher.message('updated', { message: scope.message });
            }
/**
             * Update the value of the message and send the state to the application
             * @param  {String}  val            Body
             * @param  {Boolean} dispatchAction Send the state to the app, default false.
             * @param  {Boolean} forceUpdate    Force update the message for the mode plain-text (prevent issue 6530)
             * @return {void}
             */
Update the value of the message and send the state to the application
@param  {String}  val            Body
@param  {Boolean} dispatchAction Send the state to the app, default false.
@param  {Boolean} forceUpdate    Force update the message for the mode plain-text (prevent issue 6530)
@return {void}
Update the value of the message and send the state to the application @param { String } val Body @param { Boolean } dispatchAction Send the state to the app default false . @param { Boolean } forceUpdate Force update the message for the mode plain - text ( prevent issue 6530 ) @return { void }
async function updateMessageModel(val, dispatchAction = false, forceUpdate = false) {
                if (scope.message.MIMEType === PLAINTEXT) {
                    if (forceUpdate) {
                        scope.$applyAsync(() => {
                            scope.message.setDecryptedBody(val, false);
                            dispatchAction && dispatcher.message('updated', { message: scope.message });
                        });
                    }
                    return;
                }
                const value = sanitize.message(val || '');
                const body = await embedded.parser(scope.message, { direction: 'cid', text: value });
                scope.message.setDecryptedBody(body);
                dispatchAction && dispatcher.message('updated', { message: scope.message });
            }
async function updateMessageModel ( val , dispatchAction = false , forceUpdate = false ) { if ( scope . message . MIMEType === PLAINTEXT ) { if ( forceUpdate ) { scope . $applyAsync ( ( ) => { scope . message . setDecryptedBody ( val , false ) ; dispatchAction && dispatcher . message ( 'updated' , { message : scope . message } ) ; } ) ; } return ; } const value = sanitize . message ( val || '' ) ; const body = await embedded . parser ( scope . message , { direction : 'cid' , text : value } ) ; scope . message . setDecryptedBody ( body ) ; dispatchAction && dispatcher . message ( 'updated' , { message : scope . message } ) ; }
Update the value of the message and send the state to the application
 @param  {String}  val            Body
 @param  {Boolean} dispatchAction Send the state to the app, default false.
Update the value of the message and send the state to the application @param { String } val Body @param { Boolean } dispatchAction Send the state to the app default false .
// The plaintext editor uses the message model so use $applyAsync // Dispatch an event to update the message // Sanitize the message with the DOMPurify config. // Replace the embedded images with CID to keep the model updated // Update the model (note that this does not change anything in the squire editor so $applyAsync should not be needed) // Dispatch an event to update the message