diff --git a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js index 1209391f61cc..8323750505b9 100644 --- a/packages/rocketchat-livechat/.app/client/lib/chatMessages.js +++ b/packages/rocketchat-livechat/.app/client/lib/chatMessages.js @@ -116,7 +116,7 @@ this.ChatMessages = class ChatMessages { const currentAgent = !visitor.roomSubscribed && Livechat.agent; if (currentAgent) { agent = { - _id: currentAgent._id, + agentId: currentAgent._id, username: currentAgent.username }; } diff --git a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js index 88a2ff587648..b04213c3ef61 100644 --- a/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js +++ b/packages/rocketchat-livechat/server/methods/sendMessageLivechat.js @@ -7,6 +7,11 @@ Meteor.methods({ check(rid, String); check(msg, String); + check(agent, Match.Maybe({ + agentId: String, + username: String + })); + const guest = LivechatVisitors.getVisitorByToken(token, { fields: { name: 1,