You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.4 KiB
40 lines
1.4 KiB
/* Copyright 2016 x620 <https://github.com/x620>
|
|
* Copyright 2016-2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
|
* Copyright 2017 Artyom Losev <https://it-projects.info/>
|
|
* Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
|
|
* License MIT (https://opensource.org/licenses/MIT). */
|
|
odoo.define("mail_to.MailTo", function(require) {
|
|
"use strict";
|
|
|
|
var chat_manager = require("mail_base.base").chat_manager;
|
|
|
|
var make_message_super = chat_manager.make_message;
|
|
chat_manager.make_message = function(data) {
|
|
var msg = make_message_super.call(this, data);
|
|
msg.partner_ids = data.partner_ids;
|
|
msg.channel_names = data.channel_names;
|
|
msg.recipients = data.partner_ids.concat(data.channel_names);
|
|
if (!msg.partner_ids && !msg.channel_names) {
|
|
return msg;
|
|
}
|
|
|
|
var more_recipients = "";
|
|
// Value which define more recipients
|
|
msg.more_recipients_value = 4;
|
|
for (var i = 0; i < msg.recipients.length; i++) {
|
|
if (i >= msg.more_recipients_value) {
|
|
// Append names
|
|
more_recipients += msg.recipients[i][1];
|
|
// Separate them with semicolon
|
|
if (i < msg.recipients.length - 1) {
|
|
more_recipients += "; ";
|
|
}
|
|
}
|
|
}
|
|
|
|
msg.more_recipients = more_recipients;
|
|
return msg;
|
|
};
|
|
|
|
return chat_manager;
|
|
});
|