Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jul 10, 2024
1 parent 23137d7 commit 9d05906
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions apps/meteor/app/livechat/server/lib/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ export const dispatchAgentDelegated = async (rid: string, agentId?: string) => {
});
};

/**
* @deprecated
*/

export const dispatchInquiryQueued = async (inquiry: ILivechatInquiryRecord, agent?: SelectedAgent | null) => {
if (!inquiry?._id) {
return;
Expand Down
17 changes: 9 additions & 8 deletions apps/meteor/app/livechat/server/lib/QueueManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
notifyOnLivechatInquiryChanged,
notifyOnSettingChanged,
} from '../../../lib/server/lib/notifyListener';
import { settings } from '../../../settings/server';
import { i18n } from '../../../utils/lib/i18n';
import { createLivechatRoom, createLivechatInquiry, allowAgentSkipQueue } from './Helper';
import { Livechat } from './LivechatTyped';
Expand Down Expand Up @@ -216,16 +217,16 @@ export const QueueManager = new (class {
*
*/

if (agent && !defaultAgent) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}
if (!settings.get('Livechat_accept_chats_with_no_agents')) {
if (agent && !defaultAgent) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}

if (guest.department && !department) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}
if (guest.department && !department) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}

if (!agent && !guest.department) {
if (!(await Livechat.checkOnlineAgents())) {
if (!agent && !guest.department && !(await Livechat.checkOnlineAgents())) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}
}
Expand Down

0 comments on commit 9d05906

Please sign in to comment.