Skip to content

Commit

Permalink
[FIX] Chats not getting assigned to offline agents even when "Accept …
Browse files Browse the repository at this point in the history
…with No Online agents" setting is turned on (#26147)
  • Loading branch information
murtaza98 authored Aug 16, 2022
1 parent 9d1ff90 commit 4f946a0
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions apps/meteor/app/models/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ import { settings } from '../../../settings/server';
const queryStatusAgentOnline = (extraFilters = {}) => ({
statusLivechat: 'available',
roles: 'livechat-agent',
$or: [
{
status: {
$exists: true,
$ne: 'offline',
...(!settings.get('Livechat_enabled_when_agent_idle') && {
$or: [
{
status: {
$exists: true,
$ne: 'offline',
},
roles: {
$ne: 'bot',
},
},
roles: {
$ne: 'bot',
{
roles: 'bot',
},
},
{
roles: 'bot',
},
],
],
}),
...extraFilters,
...(settings.get('Livechat_enabled_when_agent_idle') === false && {
statusConnection: { $ne: 'away' },
Expand Down

0 comments on commit 4f946a0

Please sign in to comment.