• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/ReadService.php
  • Класс: BitrixImV2MessageReadService
  • Вызов: ReadService::splitRecipientsByGroups
protected function splitRecipientsByGroups(array $counters): array
{
	$currentUserId = $this->getContext()->getUserId();
	$groups = [];

	foreach ($counters as $userId => $counter)
	{
		if ($userId === $currentUserId)
		{
			$counter = 0;
		}

		$groups[$counter]['COUNTER'] = $counter;
		$groups[$counter]['USER_IDS'][] = $userId;
	}

	return array_values($groups);
}