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

	$useWelcomeForm = $this->config['USE_WELCOME_FORM'] === 'Y';
	$welcomeFormDelay = $this->config['WELCOME_FORM_DELAY'] === 'Y';

	// if we show welcome form before dialog start
	if ($useWelcomeForm && !$welcomeFormDelay)
	{
		$clientChatId = Chat::parseLinesChatEntityId($this->session['USER_CODE'])['connectorChatId'];
		$this->clientChat = new Chat($clientChatId);
		$livechatData = $this->clientChat->getFieldData(Chat::FIELD_LIVECHAT);

		// if welcome form was filled and welcome text wasn't sent in this chat - we need to send it
		return $livechatData['WELCOME_FORM_FILLED'] === 'Y' && $livechatData['WELCOME_TEXT_SENT'] === 'N';
	}

	return false;
}