Plugin Directory

Changeset 2085546


Ignore:
Timestamp:
05/10/2019 06:14:48 PM (7 years ago)
Author:
darklrd
Message:

Support WordPress 5.2

Location:
iflychat/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • iflychat/trunk/iflychat.php

    r2051427 r2085546  
    22/**
    33 * @package iflychat
    4  * @version 4.6.1
     4 * @version 4.6.2
    55 */
    66/*
     
    99Description: One on one chat, Multiple chatrooms, Embedded chatrooms
    1010Author: iFlyChat Team
    11 Version: 4.6.1
     11Version: 4.6.2
    1212Author URI: https://iflychat.com/
    1313*/
     
    6060}
    6161
    62 define('IFLYCHAT_PLUGIN_VERSION', 'WP-4.6.1');
     62define('IFLYCHAT_PLUGIN_VERSION', 'WP-4.6.2');
    6363if (!defined('IFLYCHAT_DEBUG')) {
    6464  define('IFLYCHAT_DEBUG',          false);
     
    123123        $_iflychat_protocol = isset($_SERVER["HTTPS"]) ? 'https://' : 'http://';
    124124
    125         wp_enqueue_script('iflychat-ajax', plugin_dir_url( __FILE__ ) . 'js/iflychat.js', array(), false, true);
     125        wp_enqueue_script('iflychat-ajax', plugin_dir_url( __FILE__ ) . 'js/iflychat.js', array('jquery'), false, true);
    126126        wp_localize_script('iflychat-ajax', 'iflychat_chatcamp_check', iflychat_chatcamp_check()?"1":"0");
    127127        wp_localize_script('iflychat-ajax', 'iflychat_app_id', iflychat_get_option('iflychat_app_id'));
     
    297297        $options['body'] = json_encode(array('id' => $data['user_id']));
    298298        $options['headers'] = array('Content-Type' => 'application/json', 'x-api-key' => $data['api_key']);
    299         $result = wp_remote_head(CHATCAMP_EXTERNAL_A_HOST . ':' . CHATCAMP_EXTERNAL_A_PORT . '/api/1.0/users.get', $options);
     299        $result = wp_remote_head(CHATCAMP_EXTERNAL_A_HOST . ':' . CHATCAMP_EXTERNAL_A_PORT . '/api/2.0/users.get', $options);
    300300        if (!is_wp_error($result) && $result['response']['code'] == 200) {
    301301            $result = json_decode($result['body']);
     
    308308        else if($result['response']['code'] == 404){
    309309            $options['body'] = json_encode(iflychat_chatcamp_process_user_data($data));
    310             $result = wp_remote_head(CHATCAMP_EXTERNAL_A_HOST . ':' . CHATCAMP_EXTERNAL_A_PORT . '/api/1.0/users.create', $options);
     310            $result = wp_remote_head(CHATCAMP_EXTERNAL_A_HOST . ':' . CHATCAMP_EXTERNAL_A_PORT . '/api/2.0/users.create', $options);
    311311            if (!is_wp_error($result) && $result['response']['code'] == 200) {
    312312                $result = json_decode($result['body']);
  • iflychat/trunk/js/iflychat-popup.js

    r1974773 r2085546  
    66else if(iflychat_chatcamp_check === "1") {
    77  var iflychat_popup=document.createElement("DIV");
    8   iflychat_popup.id="cc-app";
     8  iflychat_popup.className="cc-side-chat-app";
     9  // iflychat_popup.setAttribute('data-height', '600px');
     10  // iflychat_popup.setAttribute('data-width', '370px');
    911  document.body.appendChild(iflychat_popup);
    1012}
  • iflychat/trunk/js/iflychat.js

    r1974773 r2085546  
    66}
    77else if(iflychat_chatcamp_check === "1") {
    8   iflychat_bundle.src = "//"+iflychat_external_cdn_host+"/js/chatcamp-ui.min.js";
     8  iflychat_bundle.src = "//"+iflychat_external_cdn_host+"/2.x/js/chatcamp-ui.min.js";
    99  iflychat_bundle.async="async";
    1010  document.body.appendChild(iflychat_bundle);
     
    1313      'action': 'iflychat-get'
    1414    };
    15     jQuery.post(iflychat_auth_url, data, function(response) {
    16       console.log("RE", response);
    17       // Initialize ChatCamp
    18       window.ChatCampUi.init({
    19         appId: iflychat_app_id,
    20         user: {
     15    if(typeof iflychat_auth_url!=="undefined") {
     16      jQuery.post(iflychat_auth_url, data, function(response) {
     17        console.log("RE", response);
     18        iflychat_load_cc_init({
    2119          id: response.user.id,
    2220          accessToken: response.user.access_token // optional
    23         },
    24         ui: {
    25           theme: {
    26             primaryBackground: "#3f45ad",
    27             primaryText: "#ffffff",
    28             secondaryBackground: "#ffffff",
    29             secondaryText: "#000000",
    30             tertiaryBackground: "#f4f7f9",
    31             tertiaryText: "#263238"
    32           },
    33           roster: {
    34             tabs: ['recent', 'rooms', 'users'],
    35             render: true,
    36             defaultMode: 'open', // other possible values are minimize, hidden
    37             showUserAvatarUpload: true
    38           },
    39           channel: {
    40             showAttachFile: true,
    41             showVideoCall: true,
    42             showVoiceRecording: true
    43           }
    44         }
    45       })
    46     });
     21        })
     22      });
     23    }
     24    else {
     25      jQuery.getScript(iflychat_bundle.src, function(response) {
     26        iflychat_load_cc_init({});
     27      });
     28    }
    4729  });
    4830}
     31
     32function iflychat_load_cc_init(user) {
     33  // Initialize ChatCamp
     34  window.ChatCampUi.init({
     35    appId: iflychat_app_id,
     36    user: user,
     37    ui: {
     38      theme: {
     39        primaryBackground: "#3f45ad",
     40        primaryText: "#ffffff",
     41        secondaryBackground: "#ffffff",
     42        secondaryText: "#000000",
     43        tertiaryBackground: "#f4f7f9",
     44        tertiaryText: "#263238"
     45      },
     46      roster: {
     47        tabs: ['users', 'recent', 'publicrooms'],
     48        render: true,
     49        defaultMode: 'open', // other possible values are minimize, hidden
     50        displayStartNewChatButton: true // can be either true or false
     51      },
     52      channel: {
     53        showAttachFile: true,
     54        showVideoCall: true,
     55        showVoiceRecording: true
     56      }
     57    }
     58  })
     59}
  • iflychat/trunk/readme.txt

    r2051427 r2085546  
    33Contributors: darklrd, shubhamgupta
    44Requires at least: 3.0
    5 Tested up to: 5.0
    6 Stable tag: 4.6.1
     5Tested up to: 5.3
     6Stable tag: 4.6.2
    77Tags: 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
    88License: GPLv2 or later
     
    138138== Changelog ==
    139139
     140= 4.6.2 =
     141
     14210/05/2019: Support WordPress 5.2.
     143
    140144= 4.6.1 =
    141145
     
    437441== Upgrade Notice ==
    438442
     443= 4.6.2 =
     444After updating, go to iFlyChat Settings page and click on Update button.
     445
    439446= 4.6.1 =
    440447After updating, go to iFlyChat Settings page and click on Update button.
     
    461468After updating, go to iFlyChat Settings page and click on Update button.
    462469
    463 = 4.2.4 =
    464 After updating, go to iFlyChat Settings page and click on Update button.
    465 
    466 
     470
Note: See TracChangeset for help on using the changeset viewer.