• Модуль: messageservice
  • Путь к файлу: ~/bitrix/modules/messageservice/lib/Providers/Edna/EdnaUtils.php
  • Класс: BitrixMessageServiceProvidersEdnaEdnaUtils
  • Вызов: EdnaUtils::checkActiveChannelBySubjectIdList
public function checkActiveChannelBySubjectIdList(array $subjectIdList, string $imType): bool
{
	if (empty($subjectIdList))
	{
		return false;
	}

	$channelResult = $this->getChannelList($imType);
	if (!$channelResult->isSuccess())
	{
		return false;
	}

	$checkedChannels = [];
	foreach ($channelResult->getData() as $channel)
	{
		if (
			isset($channel['active'], $channel['subjectId'])
			&& $channel['active'] === true
			&& in_array($channel['subjectId'], $subjectIdList, true)
		)
		{
			$checkedChannels[] = $channel['subjectId'];
		}
	}

	return count($checkedChannels) === count($subjectIdList);
}