Broadcast::filterRecipients

  1. Bitrix24 API (v. 23.675.0)
  2. blog
  3. Broadcast
  4. filterRecipients
  • Модуль: blog
  • Путь к файлу: ~/bitrix/modules/blog/lib/broadcast.php
  • Класс: BitrixBlogBroadcast
  • Вызов: Broadcast::filterRecipients
static function filterRecipients(array $usersId, string $notifyType): array
{
	if (!Loader::includeModule('im'))
	{
		return $usersId;
	}

	if (Manager::isSettingsMigrated())
	{
		if ($notifyType === CIMSettings::CLIENT_MAIL)
		{
			$notifyType = Notification::MAIL;
		}

		$notification = new Notification('blog', 'broadcast_post');

		return $notification->filterAllowedUsers($usersId, $notifyType);
	}

	foreach ($usersId as $key=> $userId)
	{
		if (!CIMSettings::getNotifyAccess(
			$userId,
			'blog',
			'broadcast_post',
			$notifyType
		))
		{
			unset($usersId[$key]);
		}
	}

	return $usersId;
}

Добавить комментарий