From a537a8466c6198517c8e1f65d600293bcca689b6 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 16 Nov 2015 15:34:47 +0100 Subject: [PATCH] [FIX] mail: close livechat conversations without unsubscribing The problem occured when the user in the backend (client action) closed the livechat before the user in the frontend, because we performed the wrong RPC, and the backend user was removed from the partners following the discussion. Thus, the messages sent from that point by the frontend user were never received. When closing a DM or livechat, we should call 'channel_pin', when unsubscribing from a channel, we should call 'action_unfollow'. --- addons/mail/static/src/js/chat_manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 3645cc0d8e2..6da02410141 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -550,10 +550,10 @@ var chat_manager = { unsubscribe: function (channel) { var def; - if (channel.type === "dm") { - def = ChannelModel.call('channel_pin', [channel.uuid, false]); - } else { + if (_.contains(['public', 'private'], channel.type)) { def = ChannelModel.call('action_unfollow', [[channel.id]]); + } else { + def = ChannelModel.call('channel_pin', [channel.uuid, false]); } return def.then(function () { channels = _.without(channels, channel);