From 450e970ed87b6f2735497d2b03f47a97143e6d13 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Sun, 15 Jan 2012 20:51:12 +0000 Subject: [PATCH] When enabled the groups, visitors cannot start a chat, if only operators, who don't relate to any groups, online. --- src/messenger/webim/libs/operator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index fe2870ba..b954ef19 100755 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -185,7 +185,12 @@ function has_online_operators($groupid = "") $query .= ", ${mysqlprefix}chatgroupoperator where groupid = $groupid and ${mysqlprefix}chatoperator.operatorid = " . "${mysqlprefix}chatgroupoperator.operatorid and istatus = 0"; } else { - $query .= " where istatus = 0"; + if ($settings['enablegroups'] == 1) { + $query .= ", ${mysqlprefix}chatgroupoperator where ${mysqlprefix}chatoperator.operatorid = " . + "${mysqlprefix}chatgroupoperator.operatorid and istatus = 0"; + } else { + $query .= " where istatus = 0"; + } } $row = select_one_row($query, $link); close_connection($link);