Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Livechat issues on external queue and lead capture #9750

Merged
merged 3 commits into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rocketchat-livechat/.app/client/views/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 1 addition & 9 deletions packages/rocketchat-livechat/server/hooks/leadCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-livechat/server/hooks/sendToCRM.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
4 changes: 2 additions & 2 deletions packages/rocketchat-livechat/server/lib/QueueMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};