summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread/thread.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
-rw-r--r--addons/mail/static/src/models/thread/thread.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js
index 09fcd46afed..bd40751ca59 100644
--- a/addons/mail/static/src/models/thread/thread.js
+++ b/addons/mail/static/src/models/thread/thread.js
@@ -968,6 +968,14 @@ function factory(dependencies) {
* @private
* @returns {boolean}
*/
+ _computeIsChatChannel() {
+ return this.channel_type === 'chat';
+ }
+
+ /**
+ * @private
+ * @returns {boolean}
+ */
_computeIsCurrentPartnerFollowing() {
return this.followers.some(follower =>
follower.partner && follower.partner === this.env.messaging.currentPartner
@@ -1426,6 +1434,19 @@ function factory(dependencies) {
],
}),
id: attr(),
+ /**
+ * States whether this thread is a `mail.channel` qualified as chat.
+ *
+ * Useful to list chat channels, like in messaging menu with the filter
+ * 'chat'.
+ */
+ isChatChannel: attr({
+ compute: '_computeIsChatChannel',
+ dependencies: [
+ 'channel_type',
+ ],
+ default: false,
+ }),
isCurrentPartnerFollowing: attr({
compute: '_computeIsCurrentPartnerFollowing',
default: false,