summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/models/threads/searchable_thread.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2019-08-30 15:18:04 +0000
committerAlexandre Kühn <aku@odoo.com>2019-08-30 15:18:05 +0000
commitad03cac07a4ee8dea36d5d5db9ebcedf08803f99 (patch)
tree18a03be6123b9eedcb93155b6c8fcc2f0e67b4fe /addons/mail/static/src/js/models/threads/searchable_thread.js
parent3a52b22b503f5a9b42be779a0a92ecd39721363b (diff)
[FIX] mail: channel notification messages are never marked as unread
When a user either joins and leaves a channel, it posts a message of type 'notification' with either action as content. Before this commit, such messages above were incrementing the unread counter of the channel. As a result, the messaging menu was showing this channel as unread with this message. Messages of type 'notification' should never increment the unread counter of channel. This commit fixes the issue by preventing new messages of type 'notification' to increment the unread counter of a conversation. This should also prevent increasing the counter of the messaging menu, in addition to highlighting this channel as unread from the messaging menu. Task-Id 2059515 closes odoo/odoo#36293 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js/models/threads/searchable_thread.js')
-rw-r--r--addons/mail/static/src/js/models/threads/searchable_thread.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/models/threads/searchable_thread.js b/addons/mail/static/src/js/models/threads/searchable_thread.js
index 511bc6348c8..2b9d64b2597 100644
--- a/addons/mail/static/src/js/models/threads/searchable_thread.js
+++ b/addons/mail/static/src/js/models/threads/searchable_thread.js
@@ -148,7 +148,11 @@ var SearchableThread = Thread.extend({
if (cache.messages[index] !== message) {
cache.messages.splice(index, 0, message);
}
- if (!message.isMyselfAuthor() && options.incrementUnread) {
+ if (
+ !message.isMyselfAuthor() &&
+ options.incrementUnread &&
+ message.getType() !== 'notification'
+ ) {
this._incrementUnreadCounter();
}
},