} else { if ($_POST['IM_CHAT_RENAME'] == 'Y') { CUtil::decodeURIComponent($_POST); $CIMChat = new CIMChat(); $CIMChat->Rename($_POST['CHAT_ID'], $_POST['CHAT_TITLE']); echo CUtil::PhpToJsObject(array('CHAT_ID' => intval($_POST['CHAT_ID']), 'CHAT_TITLE' => $_POST['CHAT_TITLE'], 'ERROR' => '')); } else { if ($_POST['IM_CALL'] == 'Y') { $errorMessage = ""; if ($_POST['COMMAND'] == 'invite') { CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], array('video' => $_POST['VIDEO'] == 'Y')); } else { if ($_POST['COMMAND'] == 'signaling') { CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], array('peer' => $_POST['PEER'])); } else { CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND']); } } echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage)); } else { if ($_POST['IM_START_WRITING'] == 'Y') { $errorMessage = ""; CIMMessenger::StartWriting($_POST['RECIPIENT_ID']); echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage)); } else { if ($_POST['IM_DESKTOP_LOGOUT'] == 'Y') { $errorMessage = ""; CIMMessenger::RemoveDesktopStatusOnline(); CIMContactList::SetOffline(); echo CUtil::PhpToJsObject(array('ERROR' => $errorMessage)); } else {
'CHAT_ID' => intval($_POST['CHAT_ID']), 'CHAT_TITLE' => $_POST['CHAT_TITLE'], 'ERROR' => '' )); } else if ($_POST['IM_CALL'] == 'Y') { $errorMessage = ""; if ($_POST['COMMAND'] == 'invite' || $_POST['COMMAND'] == 'busy') CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], Array('video' => ($_POST['VIDEO'] == 'Y'))); else if ($_POST['COMMAND'] == 'signaling') CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], Array('peer' => $_POST['PEER'])); else CIMMessenger::CallCommand($_POST['RECIPIENT_ID'], $_POST['COMMAND'], CUtil::JsObjectToPhp($_POST['PARAMS'])); $arUserData = CIMContactList::GetUserData(Array('ID' => array($USER->GetID(), $_POST['RECIPIENT_ID']), 'DEPARTMENT' => 'N', 'HR_PHOTO' => 'Y')); echo CUtil::PhpToJsObject(Array( 'USERS' => $arUserData['users'], 'HR_PHOTO' => $arUserData['hrphoto'], 'ERROR' => $errorMessage )); } else if ($_POST['IM_START_WRITING'] == 'Y') { $errorMessage = ""; CIMMessenger::StartWriting($_POST['RECIPIENT_ID']); echo CUtil::PhpToJsObject(Array(