• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Controller/Chat.php
  • Класс: BitrixImV2ControllerChat
  • Вызов: Chat::addAction
public function addAction(array $fields): ?array
{
	$fields['type'] = ($fields['type'] === 'CHANNEL') ? BitrixImV2Chat::IM_TYPE_CHANNEL : BitrixImV2Chat::IM_TYPE_CHAT;

	if (
		!isset($fields['entityType'])
		|| $fields['entityType'] !== 'VIDEOCONF'
		|| !isset($fields['conferencePassword'])
	)
	{
		unset($fields['conferencePassword']);
	}

	$data = self::recursiveWhiteList($fields, BitrixImV2Chat::AVAILABLE_PARAMS);
	$result = ChatFactory::getInstance()->addChat($data);
	if (!$result->isSuccess())
	{
		$this->addErrors($result->getErrors());
		return null;
	}

	return $this->convertKeysToCamelCase($result->getResult());
}