diff --git a/src/messenger/webim/operator/history.php b/src/messenger/webim/operator/history.php index 1b3efaa4..950f3565 100644 --- a/src/messenger/webim/operator/history.php +++ b/src/messenger/webim/operator/history.php @@ -58,8 +58,10 @@ if ($query !== false) { $searchConditions[] = "({chatmessage}.tmessage LIKE :query" . ($searchInSystemMessages?'':" AND ({chatmessage}.ikind = :kind_user OR {chatmessage}.ikind = :kind_agent)") . ")"; - $values[':kind_user'] = Thread::KIND_USER; - $values[':kind_agent'] = Thread::KIND_AGENT; + if (! $searchInSystemMessages) { + $values[':kind_user'] = Thread::KIND_USER; + $values[':kind_agent'] = Thread::KIND_AGENT; + } } if ($searchType == 'operator' || $searchType == 'all') { $searchConditions[] = "({chatthread}.agentName LIKE :query)";