[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'.
This commit is contained in:
Aaron Bohy
2015-11-17 10:06:18 +01:00
parent 4ce2d6f7c3
commit a537a8466c
+3 -3
View File
@@ -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);