Browse Source

remove jitsiRegionInfo from lib-jitsi-meet (#490)

* move all local deployment properties into  window.jitsiAnalyticsPermanentProperties property
no longer need to set jitsiRegionInfo from external_connect, now set from Jitsi meet local.html, can be customized by deployment

* change to using shorter lines by extracting longer property name into a shorter local variable name

* changed to using more generic variable name jitsiDeploymentInfo after discussion with the team
added comment describing source of this variable
tags/v0.0.2
Aaron van Meerten 7 years ago
parent
commit
dbee162fe9
3 changed files with 11 additions and 17 deletions
  1. 4
    2
      JitsiConference.js
  2. 7
    5
      JitsiMeetJS.js
  3. 0
    10
      connection_optimization/external_connect.js

+ 4
- 2
JitsiConference.js View File

@@ -1326,8 +1326,10 @@ JitsiConference.prototype.onIncomingCall
1326 1326
     // add info whether call is cross-region
1327 1327
     let crossRegion = null;
1328 1328
 
1329
-    if (window.jitsiRegionInfo) {
1330
-        crossRegion = window.jitsiRegionInfo.CrossRegion;
1329
+    // TODO: remove deprecated cross region property from this specific event
1330
+    // once all existing deployments include analytics changes
1331
+    if (window.jitsiDeploymentInfo) {
1332
+        crossRegion = window.jitsiDeploymentInfo.CrossRegion;
1331 1333
     }
1332 1334
     Statistics.analytics.sendEvent(
1333 1335
         'session.initiate', {

+ 7
- 5
JitsiMeetJS.js View File

@@ -129,13 +129,15 @@ export default {
129 129
         }
130 130
 
131 131
         // Log deployment-specific information, if available.
132
-        if (window.jitsiRegionInfo
133
-            && Object.keys(window.jitsiRegionInfo).length > 0) {
132
+        // Defined outside the application by individual deployments
133
+        const aprops = window.jitsiDeploymentInfo;
134
+
135
+        if (aprops && Object.keys(aprops).length > 0) {
134 136
             const logObject = {};
135 137
 
136
-            for (const attr in window.jitsiRegionInfo) {
137
-                if (window.jitsiRegionInfo.hasOwnProperty(attr)) {
138
-                    logObject[attr] = window.jitsiRegionInfo[attr];
138
+            for (const attr in aprops) {
139
+                if (aprops.hasOwnProperty(attr)) {
140
+                    logObject[attr] = aprops[attr];
139 141
                 }
140 142
             }
141 143
 

+ 0
- 10
connection_optimization/external_connect.js View File

@@ -41,16 +41,6 @@ function createConnectionExternally( // eslint-disable-line no-unused-vars
41 41
             if (xhttp.status == HTTP_STATUS_OK) {
42 42
                 try {
43 43
                     var data = JSON.parse(xhttp.responseText);
44
-
45
-                    var proxyRegion = xhttp.getResponseHeader('X-Proxy-Region');
46
-                    var jitsiRegion = xhttp.getResponseHeader('X-Jitsi-Region');
47
-                    window.jitsiRegionInfo = {
48
-                        'ProxyRegion' : proxyRegion,
49
-                        'Region' : jitsiRegion,
50
-                        'Shard' : xhttp.getResponseHeader('X-Jitsi-Shard'),
51
-                        'CrossRegion': proxyRegion !== jitsiRegion ? 1 : 0
52
-                    };
53
-
54 44
                     successCallback(data);
55 45
                 } catch (e) {
56 46
                     error_callback(e);

Loading…
Cancel
Save