From 0e253e2c50460f8fcdd727fa31d4ae25b860aac9 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 29 Jul 2012 15:44:41 -0500 Subject: [PATCH] First mod to avoid users contacting non-friends through chat - refs #5264 --- main/inc/lib/social.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 40524df63e..0c98155778 100644 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -654,9 +654,9 @@ class SocialManager extends UserManager { } } - //@todo check if user is online to show the chat link - if (api_get_setting('allow_global_chat') == 'true') { - if ($user_id != api_get_user_id()) { + //@todo check if user is online and if it's a friend to show the chat link + if (api_get_setting('allow_global_chat') == 'true' && $show_full_profile) { + if ($user_id != api_get_user_id()) { $user_name = $user_info['complete_name']; $options = array('onclick' => "javascript:chatWith('".$user_id."', '".Security::remove_XSS($user_name)."', '".$user_info['user_is_online_in_chat']."')");