RocketChat / Rocket.Chat.Livechat

New Livechat client written in Preact
https://rocket.chat/omnichannel/live-chat
MIT License
247 stars 228 forks source link

[Livechat] Non available Livechat forwarded to different Department #404

Open twintime opened 5 years ago

twintime commented 5 years ago

Description:

We've created several Departments for the Livechat. Let's call them X, Y and Z. For each of these Departments we set Show on registration page to no.

Afterwards, we created three embedded seperate Livechats Windows using the Function:

<script type="text/javascript">
(function(w, d, s, u) {
    w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
    var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
    j.async = true; j.src = 'http://ROCKETCHAT-URL/packages/rocketchat_livechat/assets/rocketchat-livechat.min.js?_=201702160944';
    h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'http://ROCKETCHAT-URL/livechat');
RocketChat(function() {
    this.setDepartment('DEPARTMENT');
});
</script>

and set under Appearance "Livechat offline--> Display Offline Form: False" which is working fine.

The problem is that as soon as Department X is Offline and Y goes Online, the Chat Window is shown again and therefore the Chats are forwarded, which is not the desired outcome.

Steps to reproduce:

Open Livechat Page for Department X when X isn't Online Livechat Window Appears User fills in their Data Livechat will be forwarded to Department Y

Expected behavior:

Show no Livechat Window when the actual Department is Offline and another one is Online.

Actual behavior:

Livechat Window for Department X comes up when Y or Z are Online

Server Setup Information:

Additional context

-

Relevant logs:

-

renatobecker-zz commented 5 years ago

Hi @twintime, the current behavior regarding the livechat status(online/offline) does not consider the status of agents related to the department defined with thesetDepartment method, but it considers if there is at least one agent online when the widget is loaded. We're aware that we need to improve this behavior and we have plans to start working on this demand ASAP, so I suggest you to keep tracking our next steps and thank you for helping us to improve our Livechat solution.

Regards.