From df38a1860fa29aaf91bd7d9d363b014901b17127 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 15 Apr 2013 11:59:21 +0000 Subject: [PATCH] Fix notice about undefined index 'visitorid' in libs/chat.php --- src/messenger/webim/libs/chat.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index 8e88afe0..242325c5 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -657,17 +657,19 @@ function chat_start_for_user($group_id, $visitor_id, $visitor_name, $referrer, $ $_SESSION['threadid'] = $thread->id; // Check if invitation accept - $operator = invitation_accept($_SESSION['visitorid'], $thread->id); - if ($operator) { - $operator = operator_by_id($operator); - $operator_name = get_operator_name($operator); - $thread->postMessage( - Thread::KIND_FOR_AGENT, - getstring2( - 'chat.visitor.invitation.accepted', - array($operator_name) - ) - ); + if (Settings::get('enabletracking')) { + $operator = invitation_accept($_SESSION['visitorid'], $thread->id); + if ($operator) { + $operator = operator_by_id($operator); + $operator_name = get_operator_name($operator); + $thread->postMessage( + Thread::KIND_FOR_AGENT, + getstring2( + 'chat.visitor.invitation.accepted', + array($operator_name) + ) + ); + } } // Send some messages