Fix livechat routing to agents that have never logged in

pull/4507/head
Diego Sampaio 9 years ago
parent bba8cc45b4
commit 4fbb26eb13
  1. 15
      packages/rocketchat-livechat/server/models/Users.js

@ -19,7 +19,10 @@ RocketChat.models.Users.setOperator = function(_id, operator) {
*/
RocketChat.models.Users.findOnlineAgents = function() {
var query = {
statusConnection: { $ne: 'offline' },
statusConnection: {
$exists: true,
$ne: 'offline'
},
statusLivechat: 'available',
roles: 'livechat-agent'
};
@ -46,7 +49,10 @@ RocketChat.models.Users.findAgents = function() {
*/
RocketChat.models.Users.findOnlineUserFromList = function(userList) {
var query = {
statusConnection: { $ne: 'offline' },
statusConnection: {
$exists: true,
$ne: 'offline'
},
statusLivechat: 'available',
roles: 'livechat-agent',
username: {
@ -63,7 +69,10 @@ RocketChat.models.Users.findOnlineUserFromList = function(userList) {
*/
RocketChat.models.Users.getNextAgent = function() {
var query = {
statusConnection: { $ne: 'offline' },
statusConnection: {
$exists: true,
$ne: 'offline'
},
statusLivechat: 'available',
roles: 'livechat-agent'
};

Loading…
Cancel
Save