function updateMessage(message, isSend) {
        const current = _.find(messagesCached, { ID: message.ID });
        const { ConversationID } = message;
        const type = tools.getTypeList();

        if (current) {
            messagesCached = _.map(messagesCached, (msg) => {
                // Force update if it's a new message
                if (isSend && msg.ID === message.ID) {
                    return message;
                }

                if (msg.ID === message.ID) {
                    const m = { ...msg, ...message };
                    // It can be 0
                    m.Type = message.Type;
                    return m;
                }

                return msg;
            });
        } else {
            messagesCached.push(message);
        }

        manageTimes(ConversationID);

        dispatcher.labelsElement('', message);
        dispatcher.foldersMessage('', message);
        dispatcher.foldersElement('', message);

        const { loaded } = _.find(conversationsCached, { ID: ConversationID }) || {};

        // We load the conversation when we receive an create / update message event if
        // the conversation is not cached and if the current state display a conversation list
        if (!loaded && type === 'conversation') {
            missingConversations.push(ConversationID);
        }

        return Promise.resolve();
    }
/**
     * Update message cached
     * @param {Object} message
     */
Update message cached
@param {Object} message
Update message cached @param { Object } message
function updateMessage(message, isSend) {
        const current = _.find(messagesCached, { ID: message.ID });
        const { ConversationID } = message;
        const type = tools.getTypeList();
        if (current) {
            messagesCached = _.map(messagesCached, (msg) => {
                if (isSend && msg.ID === message.ID) {
                    return message;
                }
                if (msg.ID === message.ID) {
                    const m = { ...msg, ...message };
                    m.Type = message.Type;
                    return m;
                }
                return msg;
            });
        } else {
            messagesCached.push(message);
        }
        manageTimes(ConversationID);
        dispatcher.labelsElement('', message);
        dispatcher.foldersMessage('', message);
        dispatcher.foldersElement('', message);
        const { loaded } = _.find(conversationsCached, { ID: ConversationID }) || {};
        if (!loaded && type === 'conversation') {
            missingConversations.push(ConversationID);
        }
        return Promise.resolve();
    }
function updateMessage ( message , isSend ) { const current = _ . find ( messagesCached , { ID : message . ID } ) ; const { ConversationID } = message ; const type = tools . getTypeList ( ) ; if ( current ) { messagesCached = _ . map ( messagesCached , ( msg ) => { if ( isSend && msg . ID === message . ID ) { return message ; } if ( msg . ID === message . ID ) { const m = { ... msg , ... message } ; m . Type = message . Type ; return m ; } return msg ; } ) ; } else { messagesCached . push ( message ) ; } manageTimes ( ConversationID ) ; dispatcher . labelsElement ( '' , message ) ; dispatcher . foldersMessage ( '' , message ) ; dispatcher . foldersElement ( '' , message ) ; const { loaded } = _ . find ( conversationsCached , { ID : ConversationID } ) || { } ; if ( ! loaded && type === 'conversation' ) { missingConversations . push ( ConversationID ) ; } return Promise . resolve ( ) ; }
Update message cached
 @param {Object} message
Update message cached @param { Object } message
// Force update if it's a new message // It can be 0 // We load the conversation when we receive an create / update message event if // the conversation is not cached and if the current state display a conversation list