[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user