• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/CounterServiceLegacy.php
  • Класс: BitrixImV2MessageCounterServiceLegacy
  • Вызов: CounterServiceLegacy::getUnreadChats
protected function getUnreadChats(?bool $isMuted = null): array
{
	$query = RecentTable::query()
		->setSelect(['CHAT_ID' => 'ITEM_CID', 'IS_MUTED' => 'RELATION.NOTIFY_BLOCK', 'DIALOG_ID' => 'ITEM_ID', 'ITEM_TYPE'])
		->where('USER_ID', $this->getContext()->getUserId())
		->where('UNREAD', true)
	;
	if (isset($isMuted))
	{
		$query->where('IS_MUTED', $isMuted);
	}

	return $query->fetchAll();
}