<commit_before>openerp.mail = function(session) {
    var _t = session.web._t,
       _lt = session.web._lt;

    var mail = session.mail = {};

    /**
     * ------------------------------------------------------------
     * FormView
     * ------------------------------------------------------------
     * 
     * Override of formview do_action method, to catch all return action about
     * mail.compose.message. The purpose is to bind 'Send by e-mail' buttons
     * and redirect them to the Chatter.
     */

    session.web.FormView = session.web.FormView.extend({
        do_action: function(action, on_close) {
            if (action.res_model == 'mail.compose.message' && this.fields && this.fields.message_ids) {
                var record_thread = this.fields.message_ids;
                var thread = record_thread.thread;
                thread.instantiate_composition_form('comment', true, false, 0, action.context);
                return false;
            }
            else {
                return this._super(action, on_close);
            }
        },
    });


    /**
     * ------------------------------------------------------------
     * ChatterUtils
     * ------------------------------------------------------------
     * 
     * This class holds a few tools method that will be used by
     * the various Chatter widgets.
     */

    mail.ChatterUtils = {

        /**
        * mail_int_mapping: structure to keep a trace of internal links mapping
        *      mail_int_mapping['model'] = {
        *          'name_get': [[id,label], [id,label], ...]
        *          'fetch_ids': [id, id, ...] } */
        //var mail_int_mapping = {};
        
        /**<commit_msg>[IMP] mail Chatter: hack of 'send by mail': do not try to redirect to the chatter when in create mode.<commit_after>openerp.mail = function(session) {
    var _t = session.web._t,
       _lt = session.web._lt;

    var mail = session.mail = {};

    /**
     * ------------------------------------------------------------
     * FormView
     * ------------------------------------------------------------
     * 
     * Override of formview do_action method, to catch all return action about
     * mail.compose.message. The purpose is to bind 'Send by e-mail' buttons
     * and redirect them to the Chatter.
     */

    session.web.FormView = session.web.FormView.extend({
        do_action: function(action, on_close) {
            if (action.res_model == 'mail.compose.message' && this.fields && this.fields.message_ids && this.fields.message_ids.view.get("actual_mode") != 'create') {
                var record_thread = this.fields.message_ids;
                var thread = record_thread.thread;
                thread.instantiate_composition_form('comment', true, false, 0, action.context);
                return false;
            }
            else {
                return this._super(action, on_close);
            }
        },
    });


    /**
     * ------------------------------------------------------------
     * ChatterUtils
     * ------------------------------------------------------------
     * 
     * This class holds a few tools method that will be used by
     * the various Chatter widgets.
     */

    mail.ChatterUtils = {

        /**
        * mail_int_mapping: structure to keep a trace of internal links mapping
        *      mail_int_mapping['model'] = {
        *          'name_get': [[id,label], [id,label], ...]
        *          'fetch_ids': [id, id, ...] } */
        //var mail_int_mapping = {};
        
        /**
{'fraction_non_alphanumeric': 0.23547486033519552, 'fraction_numerical': 0.0005586592178770949, 'mean_word_length': 1.2145949288806432, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1862124', 'n_tokens_mistral': 925, 'n_tokens_neox': 888, 'n_words': 225}