• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/automaticaction/welcome.php
  • Класс: BitrixImOpenLinesAutomaticActionWelcome
  • Вызов: Welcome::isWelcomeFormNeeded
private function isWelcomeFormNeeded(): bool
{
	if (
		$this->session['SOURCE'] !== Connector::TYPE_LIVECHAT
		|| $this->config['USE_WELCOME_FORM'] !== 'Y'
		|| $this->config['WELCOME_FORM_DELAY'] !== 'Y'
	)
	{
		return false;
	}

	if (!$this->clientChat)
	{
		$clientChatId = Chat::parseLinesChatEntityId($this->session['USER_CODE'])['connectorChatId'];
		$this->clientChat = new Chat($clientChatId);
	}

	$isFormNeeded =
		$this->clientChat->getFieldData(Chat::FIELD_LIVECHAT)['WELCOME_FORM_NEEDED'] === 'Y'
		&& $this->chat->isNowCreated();

	return $isFormNeeded;
}