I solved this problem by manually restricting the results that the search-query in history.php returns. To only return the results for the groups that the currently logged-in operator belongs to, add the 2 lines marked in bold in the code-extract below to operator/history.php (around line 48):
$x = $operator['operatorid']; // Load operatorid of currently logged-in operator into variable to use in extra added condition in query below. $escapedQuery = mysql_real_escape_string($query, $link);
select_with_pagintation("DISTINCT unix_timestamp(${mysqlprefix}chatthread.dtmcreated) as created, " .
"unix_timestamp(${mysqlprefix}chatthread.dtmmodified) as modified, ${mysqlprefix}chatthread.threadid, " .
"${mysqlprefix}chatthread.remote, ${mysqlprefix}chatthread.agentName, ${mysqlprefix}chatthread.userName, groupid, " .
"messageCount as size",
"${mysqlprefix}chatthread, ${mysqlprefix}chatmessage",
array(
"groupid IN (SELECT ${mysqlprefix}chatgroupoperator.groupid FROM ${mysqlprefix}chatgroupoperator where operatorid = $x)", "${mysqlprefix}chatmessage.threadid = ${mysqlprefix}chatthread.threadid",
"((${mysqlprefix}chatthread.userName LIKE '%%$escapedQuery%%') or (${mysqlprefix}chatmessage.tmessage LIKE '%%$escapedQuery%%'))"
),
"order by created DESC",
"DISTINCT ${mysqlprefix}chatthread.dtmcreated", $link);
mysql_close($link);
It works perfectly fine in my install, hope this helps you...
Cheers,
Marco
lead-developer
www.thesavvyfew.com