1
0
mirror of https://github.com/Mibew/mibew.git synced 2025-03-01 01:24:32 +03:00

Sent "Visitor closed chat window" message only if there was a chat

This commit is contained in:
Dmitriy Simushev 2014-10-22 14:34:06 +00:00
parent c83fd59763
commit 9753081407

View File

@ -620,18 +620,20 @@ class Thread
// Update user's last ping time // Update user's last ping time
$this->lastPingUser = 0; $this->lastPingUser = 0;
// And send a message to operator // And send a message to operator.
$message_to_post = getlocal( if ($this->state == self::STATE_CHATTING) {
'Visitor closed chat window', $message_to_post = getlocal(
null, 'Visitor closed chat window',
$this->locale, null,
true $this->locale,
); true
$this->postMessage( );
self::KIND_FOR_AGENT, $this->postMessage(
$message_to_post, self::KIND_FOR_AGENT,
array('created' => $last_ping_other_side + self::CONNECTION_TIMEOUT) $message_to_post,
); array('created' => $last_ping_other_side + self::CONNECTION_TIMEOUT)
);
}
} }
} }