• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/chat.php
  • Класс: BitrixImChat
  • Вызов: Chat::getOwnerById
static function getOwnerById($dialogId): ?int
{
	$chatId = BitrixImDialog::getChatId($dialogId);
	if (!$chatId)
	{
		return null;
	}

	$chat = BitrixImModelChatTable::getList([
		'select' => [
			'ID',
			'AUTHOR_ID',
		],
		'filter' => [
			'ID' => $chatId,
		]
	])->fetch();

	return ($chat && is_numeric($chat['AUTHOR_ID'])) ? (int)$chat['AUTHOR_ID'] : null;
}