Comet Chat Friend of All

// friend_user_id is the id of the global friend
function create_global_comet_chat_friend($user_ID) {
global $wpdb;
$now = date('Y-m-d H:i:s');
$wpdb->insert($wpdb->prefix . "bp_friends", array('initiator_user_id' => $user_ID,'friend_user_id' => '21','is_confirmed' => '1','date_created' => $now));
}

add_action('user_register', 'create_global_comet_chat_friend');

Hide Ajax chat link

<?php

function bigm_chat_switch(){
global $bp;
$the_component_name = $bp->current_component;
$the_action_name = $bp->current_action;
if($the_component_name != 'groups' && bp_displayed_user_id() != get_current_user_id()){
?>
<style>
<!--
#user-chat {display:none;}
-->
</style>
<?php
}
if($the_action_name == 'my-groups'){
?>
<style>
<!--
#user-chat {display:none;}
-->
</style>
<?php
}
}
add_action('bp_after_footer','bigm_chat_switch');
?>