From d14a778831721b00cc787d8c23d197bdad19563c Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 11 Apr 2013 12:33:49 +0000 Subject: [PATCH] Fix bug with history for search in messages --- src/messenger/webim/operator/history.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)";