summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_view/thread_view.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/models/thread_view/thread_view.js')
-rw-r--r--addons/mail/static/src/models/thread_view/thread_view.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/addons/mail/static/src/models/thread_view/thread_view.js b/addons/mail/static/src/models/thread_view/thread_view.js
index f2c64dabe2c..ee53e616b1c 100644
--- a/addons/mail/static/src/models/thread_view/thread_view.js
+++ b/addons/mail/static/src/models/thread_view/thread_view.js
@@ -47,8 +47,8 @@ function factory(dependencies) {
markComponentHintProcessed(hint) {
let filterFun;
switch (hint.type) {
- case 'current-partner-just-posted-message':
- filterFun = h => h.type !== hint.type && h.messageId !== hint.data.messageId;
+ case 'message-received':
+ filterFun = h => h.type !== hint.type && h.message !== hint.data.message;
break;
default:
filterFun = h => h.type !== hint.type;
@@ -57,6 +57,10 @@ function factory(dependencies) {
this.update({
componentHintList: this.componentHintList.filter(filterFun),
});
+ this.env.messagingBus.trigger('o-thread-view-hint-processed', {
+ hint,
+ threadViewer: this.threadViewer,
+ });
}
/**
@@ -197,6 +201,12 @@ function factory(dependencies) {
isPreparingLoading: attr({
default: false,
}),
+ /**
+ * Determines whether `this` should automatically scroll on receiving
+ * a new message. Detection of new message is done through the component
+ * hint `message-received`.
+ */
+ hasAutoScrollOnMessageReceived: attr(),
lastMessage: many2one('mail.message', {
related: 'thread.lastMessage',
}),