From 257371bab52b009c027ead19857fbd865f2bc5b4 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 15 Jun 2020 11:07:54 +0000 Subject: [FIX] mail: discuss: unpin channel fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIX: use the correct API of mail.channel.py to unfollow a channel i.e.: `execute_command_leave` FIX: unpinning a channel has immediate effect on the interface chatWindows are closed, and the inbox is displayed FIX: unpinning a channel destroys corresponding chatWindows across tabs It also unpins the channel in other tabs FIX: python sends is_pinned as part of the channel_info both at init messaging and in the main bus notification That way, we can keep track of the synchronization of the pin status between JS and python task-2275000 task-2267941 closes odoo/odoo#53703 X-original-commit: d4fcc64acb2fc0c6fd9df505380f665abd8b39c4 Signed-off-by: Alexandre Kühn (aku) --- .../models/messaging_initializer/messaging_initializer.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'addons/mail/static/src/models/messaging_initializer/messaging_initializer.js') diff --git a/addons/mail/static/src/models/messaging_initializer/messaging_initializer.js b/addons/mail/static/src/models/messaging_initializer/messaging_initializer.js index 3cee3777d3a..5bcebff0af5 100644 --- a/addons/mail/static/src/models/messaging_initializer/messaging_initializer.js +++ b/addons/mail/static/src/models/messaging_initializer/messaging_initializer.js @@ -22,19 +22,19 @@ function factory(dependencies) { this.messaging.update({ history: [['create', { id: 'history', - isPinned: true, + isServerPinned: true, model: 'mail.box', name: this.env._t("History"), }]], inbox: [['create', { id: 'inbox', - isPinned: true, + isServerPinned: true, model: 'mail.box', name: this.env._t("Inbox"), }]], starred: [['create', { id: 'starred', - isPinned: true, + isServerPinned: true, model: 'mail.box', name: this.env._t("Starred"), }]], @@ -144,11 +144,9 @@ function factory(dependencies) { channel_private_group = [], } = {}) { for (const data of channel_channel.concat(channel_direct_message, channel_private_group)) { - this.env.models['mail.thread'].insert(Object.assign( - {}, + this.env.models['mail.thread'].insert( this.env.models['mail.thread'].convertData(data), - { isPinned: true } - )); + ); } } @@ -192,7 +190,7 @@ function factory(dependencies) { moderation: [['create', { counter: moderation_counter, id: 'moderation', - isPinned: true, + isServerPinned: true, model: 'mail.box', name: this.env._t("Moderation"), }]], -- cgit v1.2.3