Changeset 1947153
- Timestamp:
- 09/26/2018 04:25:37 AM (8 years ago)
- File:
-
- 1 edited
-
cometchat/trunk/includes/cometchat_cloud.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cometchat/trunk/includes/cometchat_cloud.php
r1936608 r1947153 115 115 } 116 116 117 if(function_exists('bp_get_friend_ids')) { 118 $friends = bp_get_friend_ids($user_id); 119 if(empty($friends)){ 120 $friends = ""; 121 } 122 } 117 123 $user_info = array( 118 "id" => $user_id, 119 "n" => $user_name, 120 "dn" => $display_name, 121 "a" => $avatar, 122 "l" => $link, 123 'role' => $role 124 "id" => $user_id, 125 "n" => $user_name, 126 "dn" => $display_name, 127 "a" => $avatar, 128 "l" => $link, 129 "role" => $role, 130 "friends" => $friends 124 131 ); 125 132 $cc_base = json_encode($user_info); 126 }127 }128 129 /**130 * addCometChatFriends131 * Return add friends to cometchat table132 * @param (type) no param133 */134 function addCometChatFriends() {135 global $cc_clientid;136 global $current_user;137 $user_id = $current_user->ID;138 139 if(function_exists('bp_get_friend_ids')) {140 141 $friends = bp_get_friend_ids($user_id);142 $friends_data = array("id"=>$user_id,"f"=>$friends);143 $friends_ids = json_encode($friends_data);144 $site_url = get_site_url();145 $protocol = parse_url($site_url);146 $request_url = $protocol['scheme'].'://'.$cc_clientid.'.cometondemand.net/cometchat_update.php';147 148 if(function_exists('curl_init')){149 $result = wp_remote_post($request_url, array(150 'method' => 'POST',151 'body' => 'userinfo='.$friends_ids152 )153 );154 }155 133 } 156 134 } … … 240 218 241 219 if(function_exists('bp_is_active')) { 242 add_action('init','addCometChatFriends');243 220 add_action( 'groups_group_create_complete', 'createGroupInCometChat' ); 244 221 add_action( 'groups_delete_group', 'deleteGroupFromCometChat' );
Note: See TracChangeset
for help on using the changeset viewer.