• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/User/User.php
  • Класс: BitrixImV2EntityUserUser
  • Вызов: User::hasAccessBySocialNetwork
protected function hasAccessBySocialNetwork(int $idOtherUser): bool
{
	$isContactPrivacy = (
		CIMSettings::GetPrivacy(CIMSettings::PRIVACY_MESSAGE) === CIMSettings::PRIVACY_RESULT_CONTACT
		|| CIMSettings::GetPrivacy(CIMSettings::PRIVACY_MESSAGE, $this->getId()) === CIMSettings::PRIVACY_RESULT_CONTACT
	);

	return !(
		$isContactPrivacy
		&& static::$loader::includeModule('socialnetwork')
		&& CSocNetUser::IsFriendsAllowed()
		&& !CSocNetUserRelations::IsFriends($this->getId(), $idOtherUser)
	);
}