function set_privacy($profile)
{
if (is_rt_admin()) {
return 60;
}
$user = $this->visitor_id();
$privacy = 0;
if ($user) {
$privacy = 20;
}
if (false === $profile) {
$profile = $this->profile_id();
}
if (class_exists('BuddyPress') && bp_is_active('friends')) {
if (friends_check_friendship_status($user, $profile)) {
$privacy = 40;
}
}
if ($user === $profile) {
$privacy = 60;
}
return $privacy;
}