From a53842d8c73fe8bc528254c518913e16c949f553 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 16 Feb 2018 17:34:21 -0200 Subject: [PATCH 1/3] Fix department typo --- packages/rocketchat-livechat/.app/client/views/register.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-livechat/.app/client/views/register.js b/packages/rocketchat-livechat/.app/client/views/register.js index 000b7f8a8399..19a6ffa8e5c9 100644 --- a/packages/rocketchat-livechat/.app/client/views/register.js +++ b/packages/rocketchat-livechat/.app/client/views/register.js @@ -51,7 +51,7 @@ Template.register.events({ token: visitor.getToken(), name: $name.val(), email: $email.val(), - department: Livechat.deparment || departmentId + department: Livechat.department || departmentId }; Meteor.call('livechat:registerGuest', guest, function(error, result) { if (error != null) { From 523b3797b99a9477dc711523c53e1f345b45e984 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 16 Feb 2018 17:34:53 -0200 Subject: [PATCH 2/3] Fix lead capture depending on Facebook integration --- .../rocketchat-livechat/server/hooks/leadCapture.js | 10 +--------- packages/rocketchat-livechat/server/hooks/sendToCRM.js | 3 +++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/rocketchat-livechat/server/hooks/leadCapture.js b/packages/rocketchat-livechat/server/hooks/leadCapture.js index 0d3cc63e66bf..905cd993cb26 100644 --- a/packages/rocketchat-livechat/server/hooks/leadCapture.js +++ b/packages/rocketchat-livechat/server/hooks/leadCapture.js @@ -6,11 +6,7 @@ function validateMessage(message, room) { return false; } - if (!RocketChat.settings.get('Livechat_Facebook_Enabled')) { - return false; - } - - // only send the sms by SMS if it is a livechat room with SMS set to true + // message valid only if it is a livechat room if (!(typeof room.t !== 'undefined' && room.t === 'l' && room.v && room.v.token)) { return false; } @@ -29,10 +25,6 @@ function validateMessage(message, room) { } RocketChat.callbacks.add('afterSaveMessage', function(message, room) { - if (!RocketChat.settings.get('Livechat_webhook_on_capture')) { - return message; - } - if (!validateMessage(message, room)) { return message; } diff --git a/packages/rocketchat-livechat/server/hooks/sendToCRM.js b/packages/rocketchat-livechat/server/hooks/sendToCRM.js index 8b2926997a29..8ae0073ff27b 100644 --- a/packages/rocketchat-livechat/server/hooks/sendToCRM.js +++ b/packages/rocketchat-livechat/server/hooks/sendToCRM.js @@ -50,5 +50,8 @@ RocketChat.callbacks.add('livechat.saveInfo', (room) => { }, RocketChat.callbacks.priority.MEDIUM, 'livechat-send-crm-save-info'); RocketChat.callbacks.add('livechat.leadCapture', (room) => { + if (!RocketChat.settings.get('Livechat_webhook_on_capture')) { + return room; + } return sendToCRM('LeadCapture', room, false); }, RocketChat.callbacks.priority.MEDIUM, 'livechat-send-crm-lead-capture'); From d6ce94a5e5ce154bb8ee521088efa5172855592a Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 16 Feb 2018 17:35:10 -0200 Subject: [PATCH 3/3] Fix external queue not using pre-selected agent --- packages/rocketchat-livechat/server/lib/QueueMethods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-livechat/server/lib/QueueMethods.js b/packages/rocketchat-livechat/server/lib/QueueMethods.js index 831b4407efa0..b7b600bbc46c 100644 --- a/packages/rocketchat-livechat/server/lib/QueueMethods.js +++ b/packages/rocketchat-livechat/server/lib/QueueMethods.js @@ -141,7 +141,7 @@ RocketChat.QueueMethods = { return room; }, - 'External'(guest, message, roomInfo) { - return this['Least_Amount'](guest, message, roomInfo); // eslint-disable-line + 'External'(guest, message, roomInfo, agent) { + return this['Least_Amount'](guest, message, roomInfo, agent); // eslint-disable-line } };