• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/call/integration/chat.php
  • Класс: BitrixImCallIntegrationChat
  • Вызов: Chat::canStartCall
public function canStartCall(int $userId): bool
{
	if (Common::isChatId($this->entityId))
	{
		return Dialog::hasAccess($this->entityId, $userId);
	}

	if (
		CIMSettings::GetPrivacy(CIMSettings::PRIVACY_CALL) == CIMSettings::PRIVACY_RESULT_CONTACT
		&& CModule::IncludeModule('socialnetwork')
		&& CSocNetUser::IsFriendsAllowed()
		&& !CSocNetUserRelations::IsFriends($this->entityId, $userId)
	)
	{
		return false;
	}

	if (
		CIMSettings::GetPrivacy(CIMSettings::PRIVACY_CALL, $this->entityId) === CIMSettings::PRIVACY_RESULT_CONTACT
		&& CModule::IncludeModule('socialnetwork')
		&& CSocNetUser::IsFriendsAllowed()
		&& !CSocNetUserRelations::IsFriends($this->entityId, $userId)
	)
	{
		return false;
	}

	return true;
}