• Модуль: messageservice
  • Путь к файлу: ~/bitrix/modules/messageservice/lib/Providers/Edna/EdnaUtils.php
  • Класс: BitrixMessageServiceProvidersEdnaEdnaUtils
  • Вызов: EdnaUtils::getActiveChannelList
public function getActiveChannelList(string $imType): Result
{
	$channelListResult = $this->getChannelList($imType);
	if (!$channelListResult->isSuccess())
	{
		return $channelListResult;
	}

	$activeChannelList = [];
	foreach ($channelListResult->getData() as $channel)
	{
		if (isset($channel['active'], $channel['subjectId']) && $channel['active'] === true)
		{
			$activeChannelList[] = $channel;
		}
	}

	if (empty($activeChannelList))
	{
		return (new Result())->addError(new Error('There are no active channels'));
	}

	return (new Result())->setData($activeChannelList);
}