• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/crm/common.php
  • Класс: BitrixImOpenLinesCrmCommon
  • Вызов: Common::getCommunicationType
static function getCommunicationType($userCode, $noImol = false)
{
	$parsedUserCode = SessionCommon::parseUserCode($userCode);
	$messengerType = $parsedUserCode['CONNECTOR_ID'];

	if ($messengerType == 'telegrambot')
	{
		$communicationType = 'TELEGRAM';
	}
	elseif ($messengerType == 'facebook')
	{
		$communicationType = 'FACEBOOK';
	}
	elseif ($messengerType == 'vkgroup')
	{
		$communicationType = 'VK';
	}
	elseif ($messengerType == 'network')
	{
		$communicationType = 'BITRIX24';
	}
	elseif ($messengerType == 'livechat')
	{
		$communicationType = 'OPENLINE';
	}
	elseif ($messengerType == 'viber')
	{
		$communicationType = 'VIBER';
	}
	elseif ($messengerType == 'instagram')
	{
		$communicationType = 'INSTAGRAM';
	}
	elseif ($messengerType == 'fbinstagram')
	{
		$communicationType = 'INSTAGRAM';
	}
	else
	{
		if($noImol === true)
		{
			$communicationType = mb_strtoupper($messengerType);
		}
		else
		{
			$communicationType = 'IMOL';
		}
	}
	return $communicationType;
}