• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/model/chat.php
  • Класс: BitrixImModelChatTable
  • Вызов: ChatTable::getChatUserNameList
static function getChatUserNameList(ChatIndex $chatIndex): array
{
	if (!$chatIndex->isEmptyUsers())
	{
		return $chatIndex->getClearedUserList();
	}

	$query =
		BitrixImModelRelationTable::query()
			->addSelect('USER_ID')
			->where('CHAT_ID', $chatIndex->getChatId())
			->setLimit(100)
	;

	$clearedUsers = [];
	foreach ($query->exec() as $relation)
	{
		$rowUserName = BitrixImUser::getInstance($relation['USER_ID'])->getFullName(false);
		$clearedUsers[] = ChatIndex::clearText($rowUserName);
	}

	return $clearedUsers;
}