diff --git a/lib/Transformer.js b/lib/Transformer.js index 87136d0..2fb3db3 100644 --- a/lib/Transformer.js +++ b/lib/Transformer.js @@ -21,6 +21,8 @@ module.exports = { conversationDetails.__myRole = role)); // getMyRole is deprecated. Please use sdk.agentId conversationDetails.getMyRole = () => conversationDetails.__myRole; + conversationDetails.__oldParticipants = []; + conversationDetails.participants.forEach(p => conversationDetails.__oldParticipants.push(p)); conversationDetails.participants = []; Object.keys(conversationDetails.participantsPId).forEach(role => conversationDetails.participantsPId[role].forEach(id => @@ -37,7 +39,7 @@ module.exports = { }, '.ams.cm.UpdateConversationField': (msg, agent) => { msg.body.conversationField.forEach(f => { - if (f.field === 'ParticipantsChange') { + if (f.field === 'ParticipantsChange' && !f.userId) { f.userId = agent.__oldAgentId; } });