diff --git a/addons/im_livechat/static/src/components/notification_list/notification_list.js b/addons/im_livechat/static/src/components/notification_list/notification_list.js
deleted file mode 100644
index 10499b86249..00000000000
--- a/addons/im_livechat/static/src/components/notification_list/notification_list.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @odoo-module **/
-
-import { NotificationList } from '@mail/components/notification_list/notification_list';
-import { patch } from 'web.utils';
-
-const components = { NotificationList };
-
-components.NotificationList._allowedFilters.push('livechat');
-
-patch(components.NotificationList.prototype, 'im_livechat/static/src/components/notification_list/notification_list.js', {
-
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- /**
- * Override to include livechat channels.
- *
- * @override
- */
- _getThreads(props) {
- if (props.filter === 'livechat') {
- return this.messaging.models['Thread'].all(thread =>
- thread.channel_type === 'livechat' &&
- thread.isPinned &&
- thread.model === 'mail.channel'
- );
- }
- return this._super(...arguments);
- },
-
-});
diff --git a/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js b/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js
index 2760850225d..730a02aae6c 100644
--- a/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js
+++ b/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js
@@ -16,7 +16,7 @@ patch(components.ThreadNeedactionPreview.prototype, 'thread_needaction_preview',
* @override
*/
image(...args) {
- if (this.thread.channel_type === 'livechat') {
+ if (this.threadNeedactionPreviewView.thread.channel_type === 'livechat') {
return '/mail/static/src/img/smiley/avatar.jpg';
}
return this._super(...args);
diff --git a/addons/im_livechat/static/src/components/thread_preview/thread_preview.js b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js
index 46b65eb6fdd..d3e44e46967 100644
--- a/addons/im_livechat/static/src/components/thread_preview/thread_preview.js
+++ b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js
@@ -16,7 +16,7 @@ patch(components.ThreadPreview.prototype, 'im_livechat/static/src/components/thr
* @override
*/
image(...args) {
- if (this.thread.channel_type === 'livechat') {
+ if (this.threadPreviewView.thread.channel_type === 'livechat') {
return '/mail/static/src/img/smiley/avatar.jpg';
}
return this._super(...args);
diff --git a/addons/im_livechat/static/src/models/notification_list_view/notification_list_view.js b/addons/im_livechat/static/src/models/notification_list_view/notification_list_view.js
new file mode 100644
index 00000000000..7679c784300
--- /dev/null
+++ b/addons/im_livechat/static/src/models/notification_list_view/notification_list_view.js
@@ -0,0 +1,21 @@
+/** @odoo-module **/
+
+import { patchRecordMethods } from '@mail/model/model_core';
+import { replace } from '@mail/model/model_field_command';
+import '@mail/models/notification_list_view/notification_list_view'; // ensure the model definition is loaded before the patch
+
+patchRecordMethods('NotificationListView', {
+ /**
+ * @override
+ */
+ _computeFilteredThreads() {
+ if (this.filter === 'livechat') {
+ return replace(this.messaging.models['Thread'].all(thread =>
+ thread.channel_type === 'livechat' &&
+ thread.isPinned &&
+ thread.model === 'mail.channel'
+ ));
+ }
+ return this._super();
+ },
+});
diff --git a/addons/mail/static/src/components/discuss/discuss.xml b/addons/mail/static/src/components/discuss/discuss.xml
index 6a9a03bc3c1..1e52dde7ea8 100644
--- a/addons/mail/static/src/components/discuss/discuss.xml
+++ b/addons/mail/static/src/components/discuss/discuss.xml
@@ -71,10 +71,9 @@
New Channel
-
+
+
+
-
+
+
+
-
+