summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/services/mail_manager.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2019-05-08 08:10:31 +0000
committerAlexandre Kühn <aku@odoo.com>2019-05-20 07:35:12 +0000
commitb5ce994762722cfbc2519bd87bcb66c68fa04981 (patch)
treeec1584d9a994e2a1381339269009bedff154c8f6 /addons/mail/static/src/js/services/mail_manager.js
parenta31b7f4a3ed11a6f11d87a772f01cc8bb8b83c37 (diff)
[FIX] im_support, mail: message with odoobot as author
Before this commit, the `author_id` of a message with odoobot was `"ODOOBOT"`. This leads to some issues due to `author_id` being considered as an array `[partnerID, name]`. Because of this, mail status manager was registering a partner with ID `"O"` (1st char of `"ODOOBOT"`) for fetching its `im_status`. Its `im_status` was never updated, since no partner has such ID. However, the mail status manager kept this partner flagged with missing `im_status` and still attempted to fetch its `im_status`, indefinitely. This commit fixes the issue by turning `author_id` of a message with odoobot into arrray `["ODOOBOT", "ODOOBOT"]`. That way, `author_id` of a message is always an array, and the `im_status` of `"ODOOBOT"` is no longer fetched.
Diffstat (limited to 'addons/mail/static/src/js/services/mail_manager.js')
-rw-r--r--addons/mail/static/src/js/services/mail_manager.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/services/mail_manager.js b/addons/mail/static/src/js/services/mail_manager.js
index 5eb588d24e7..394892952c4 100644
--- a/addons/mail/static/src/js/services/mail_manager.js
+++ b/addons/mail/static/src/js/services/mail_manager.js
@@ -46,7 +46,7 @@ var PREVIEW_MSG_MAX_SIZE = 350; // optimal for native english speakers
var MailManager = AbstractService.extend({
dependencies: ['ajax', 'bus_service', 'local_storage'],
- _ODOOBOT_ID: "ODOOBOT", // default authorID for transient messages
+ _ODOOBOT_ID: ["ODOOBOT", "ODOOBOT"], // authorID for transient messages
/**
* @override
@@ -258,7 +258,7 @@ var MailManager = AbstractService.extend({
/**
* Get the OdooBot ID, which is the default authorID for transient messages
*
- * @returns {string}
+ * @returns {Array<string>}
*/
getOdoobotID: function () {
return this._ODOOBOT_ID;