Changeset 2100434
- Timestamp:
- 06/04/2019 01:24:19 PM (7 years ago)
- Location:
- iflychat/trunk
- Files:
-
- 2 edited
-
iflychat.php (modified) (6 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iflychat/trunk/iflychat.php
r2087821 r2100434 2 2 /** 3 3 * @package iflychat 4 * @version 4.6. 34 * @version 4.6.4 5 5 */ 6 6 /* … … 9 9 Description: One on one chat, Multiple chatrooms, Embedded chatrooms 10 10 Author: iFlyChat Team 11 Version: 4.6. 311 Version: 4.6.4 12 12 Author URI: https://iflychat.com/ 13 13 */ … … 60 60 } 61 61 62 define('IFLYCHAT_PLUGIN_VERSION', 'WP-4.6. 3');62 define('IFLYCHAT_PLUGIN_VERSION', 'WP-4.6.4'); 63 63 if (!defined('IFLYCHAT_DEBUG')) { 64 64 define('IFLYCHAT_DEBUG', false); … … 302 302 if (is_user_logged_in()) { 303 303 $_SESSION['token'] = $result->access_token; 304 // print_r($result);exit; 304 $result->current_user = $current_user; 305 $result->test_data = $data; 306 $should_update = false; 307 $should_update = iflychat_chatcamp_user_should_update($data, $result->user); 308 if($should_update === true){ 309 $options['body'] = json_encode(iflychat_chatcamp_process_user_data($data)); 310 $result = wp_remote_head(CHATCAMP_EXTERNAL_A_HOST . ':' . CHATCAMP_EXTERNAL_A_PORT . '/api/2.0/users.update', $options); 311 if (!is_wp_error($result) && $result['response']['code'] == 200) { 312 $result = json_decode($result['body']); 313 if (is_user_logged_in()) { 314 $_SESSION['token'] = $result->access_token; 315 $result->current_user = $current_user; 316 // print_r($result);exit; 317 } 318 return $result; 319 } 320 else if(!is_wp_error($result) && $result['response']['code'] != 200){ 321 return $result['response']; 322 } 323 else { 324 $error = array( 325 'code' => $result->get_error_code(), 326 'message' => $result->get_error_message() 327 ); 328 return $error; 329 } 330 } 305 331 } 306 332 return $result; … … 313 339 if (is_user_logged_in()) { 314 340 $_SESSION['token'] = $result->access_token; 341 $result->current_user = $current_user; 315 342 // print_r($result);exit; 316 343 } … … 1220 1247 $data['check_access_token'] = true; 1221 1248 $data['access_token'] = iflychat_get_hash_session(); 1249 $data['metadata'] = array("cc_user_roles" => json_encode($data['user_roles'])); 1222 1250 return $data; 1223 1251 } 1224 1252 1253 function iflychat_chatcamp_user_should_update($new, $old) { 1254 $update = false; 1255 if($new['user_name'] != $old->display_name){ 1256 $update = true; 1257 } 1258 1259 if($new['user_avatar_url'] != $old->avatar_url){ 1260 $update = true; 1261 } 1262 1263 if($new['user_profile_url'] != $old->profile_url){ 1264 $update = true; 1265 } 1266 1267 if(json_encode($new['user_roles']) !== $old->metadata->cc_user_roles){ 1268 $update = true; 1269 } 1270 1271 return $update; 1272 } 1273 1225 1274 ?> -
iflychat/trunk/readme.txt
r2087821 r2100434 4 4 Requires at least: 3.0 5 5 Tested up to: 5.3 6 Stable tag: 4.6. 36 Stable tag: 4.6.4 7 7 Tags: buddypress, chat, chat room, community, embed chat, friends, group chat, html5 chat, one to one chat, live chat, popup chat, mobile chat, multisite, wordpress chat, wp chat, ultimate member 8 8 License: GPLv2 or later … … 138 138 == Changelog == 139 139 140 = 4.6.4 = 141 142 14/05/2019: iFlyChat new backend update. 143 140 144 = 4.6.3 = 141 145 … … 445 449 == Upgrade Notice == 446 450 451 = 4.6.4 = 452 After updating, go to iFlyChat Settings page and click on Update button. 453 447 454 = 4.6.3 = 448 455 After updating, go to iFlyChat Settings page and click on Update button. … … 469 476 After updating, go to iFlyChat Settings page and click on Update button. 470 477 471 = 4.3.0 = 472 After updating, go to iFlyChat Settings page and click on Update button. 473 474 478
Note: See TracChangeset
for help on using the changeset viewer.