Skip to content

Commit

Permalink
Fix room not being assigned to bot agent first. (#20662)
Browse files Browse the repository at this point in the history
  • Loading branch information
renatobecker authored and sampaiodiego committed Feb 10, 2021
1 parent e4e335d commit 5d512f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/livechat/server/lib/RoutingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
forwardRoomToDepartment,
removeAgentFromSubscription,
updateChatDepartment,
allowAgentSkipQueue,
} from './Helper';
import { callbacks } from '../../../callbacks/server';
import { LivechatRooms, Rooms, Messages, Users, LivechatInquiry } from '../../../models/server';
Expand Down Expand Up @@ -44,7 +45,7 @@ export const RoutingManager = {

async delegateInquiry(inquiry, agent) {
const { department, rid } = inquiry;
if (!agent || (agent.username && !Users.findOneOnlineAgentByUsername(agent.username))) {
if (!agent || (agent.username && !Users.findOneOnlineAgentByUsername(agent.username) && !allowAgentSkipQueue(agent))) {
agent = await this.getNextAgent(department);
}

Expand Down

0 comments on commit 5d512f4

Please sign in to comment.