summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread_windows
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js/thread_windows')
-rw-r--r--addons/mail/static/src/js/thread_windows/abstract_thread_window.js18
-rw-r--r--addons/mail/static/src/js/thread_windows/thread_window.js17
2 files changed, 26 insertions, 9 deletions
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
index f4bf9533ff9..3e4e2e16325 100644
--- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
@@ -139,6 +139,15 @@ var AbstractThreadWindow = Widget.extend({
return this._getThreadID();
},
/**
+ * @returns {mail.model.Thread|undefined}
+ */
+ getThread: function () {
+ if (!this.hasThread) {
+ return undefined;
+ }
+ return this._thread;
+ },
+ /**
* Get the status of the thread, such as the im status of a DM chat
* ('online', 'offline', etc.). If this window has no thread, returns
* `undefined`.
@@ -257,14 +266,6 @@ var AbstractThreadWindow = Widget.extend({
QWeb.render('mail.AbstractThreadWindow.HeaderContent', options));
},
/**
- * Render the 'is typing...' notification bar text on the thread in this
- * thread window. This is called when there is a change in the list of users
- * currently typing something on this thread.
- */
- renderTypingNotificationBar: function () {
- this._threadWidget.renderTypingNotificationBar(this._thread);
- },
- /**
* Scroll to the bottom of the thread in the thread window
*/
scrollToBottom: function () {
@@ -339,6 +340,7 @@ var AbstractThreadWindow = Widget.extend({
_getHeaderRenderingOptions: function () {
return {
status: this.getThreadStatus(),
+ thread: this.getThread(),
title: this.getTitle(),
unreadCounter: this.getUnreadCounter(),
widget: this,
diff --git a/addons/mail/static/src/js/thread_windows/thread_window.js b/addons/mail/static/src/js/thread_windows/thread_window.js
index 62468e9ea16..f4b0137c476 100644
--- a/addons/mail/static/src/js/thread_windows/thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/thread_window.js
@@ -55,6 +55,9 @@ var ThreadWindow = AbstractThreadWindow.extend({
var superDef = this._super().then(this._listenThreadWidget.bind(this));
+ this.call('mail_service', 'getMailBus')
+ .on('update_typing_partners', this, this._onUpdateTypingPartners);
+
var composerDef;
if (!this.hasThread()) {
this._startWithoutThread();
@@ -353,7 +356,19 @@ var ThreadWindow = AbstractThreadWindow.extend({
var message = this.call('mail_service', 'getMessage', messageID);
message.toggleStarStatus();
},
-
+ /**
+ * @private
+ * @param {integer|string} threadID
+ */
+ _onUpdateTypingPartners: function (threadID) {
+ if (!this.hasThread()) {
+ return;
+ }
+ if (this._thread.getID() !== threadID) {
+ return;
+ }
+ this.renderHeader();
+ },
});
return ThreadWindow;