From c6e5e230570272ce40f269a588111541f5dd4711 Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Tue, 24 Jan 2012 16:40:11 +0400 Subject: [PATCH] Fix bug in old threads cleansing --- src/messenger/webim/libs/chat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index ca48739d..23d2a55b 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -575,7 +575,7 @@ function close_old_threads($link) } $next_revision = next_revision($link); $query = "update ${mysqlprefix}chatthread set lrevision = $next_revision, dtmmodified = CURRENT_TIMESTAMP, istate = $state_closed " . - "where istate <> $state_closed and istate <> $state_left and " . + "where istate <> $state_closed and istate <> $state_left and lastpingagent <> 0 and lastpinguser <> 0 and " . "(ABS(UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - UNIX_TIMESTAMP(lastpinguser)) > " . $settings['thread_lifetime'] . " and " . "ABS(UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - UNIX_TIMESTAMP(lastpingagent)) > " . $settings['thread_lifetime'] . ")";