Browse Source

Merge pull request #2079 from jitsi/update_strophe

ref(strophe): Remove and cleanup all strophe related code.
j8
Saúl Ibarra Corretgé 8 years ago
parent
commit
f1cc057bde

+ 0
- 2
app.js View File

@@ -3,8 +3,6 @@
3 3
 import 'jquery';
4 4
 import 'jquery-contextmenu';
5 5
 import 'jquery-ui';
6
-import 'strophe';
7
-import 'strophe-disco';
8 6
 import 'jQuery-Impromptu';
9 7
 import 'autosize';
10 8
 

+ 2
- 4
package.json View File

@@ -49,6 +49,7 @@
49 49
     "jwt-decode": "2.2.0",
50 50
     "lib-jitsi-meet": "jitsi/lib-jitsi-meet",
51 51
     "lodash": "4.17.4",
52
+    "js-md5": "0.6.1",
52 53
     "nuclear-js": "1.4.0",
53 54
     "postis": "2.2.0",
54 55
     "prop-types": "15.6.0",
@@ -69,8 +70,6 @@
69 70
     "react-redux": "5.0.6",
70 71
     "redux": "3.7.2",
71 72
     "redux-thunk": "2.2.0",
72
-    "strophe": "1.2.4",
73
-    "strophejs-plugins": "0.0.7",
74 73
     "styled-components": "1.3.0",
75 74
     "url-polyfill": "github:github/url-polyfill",
76 75
     "uuid": "3.1.0",
@@ -120,7 +119,6 @@
120 119
     "aui-experimental": "@atlassian/aui/lib/js/aui-experimental.js",
121 120
     "aui-experimental-css": "./node_modules/@atlassian/aui/dist/aui/css/aui-experimental.min.css",
122 121
     "autosize": "./node_modules/autosize/build/jquery.autosize.js",
123
-    "jQuery-Impromptu": "jQuery-Impromptu/src/jquery-impromptu.js",
124
-    "strophe-disco": "./node_modules/strophejs-plugins/disco/strophe.disco.js"
122
+    "jQuery-Impromptu": "jQuery-Impromptu/src/jquery-impromptu.js"
125 123
   }
126 124
 }

+ 1
- 9
react/features/base/lib-jitsi-meet/_.native.js View File

@@ -1,7 +1,6 @@
1 1
 import './native';
2 2
 
3
-// The library lib-jitsi-meet (externally) depends on the libraries jQuery and
4
-// Strophe
3
+// The library lib-jitsi-meet (externally) depends on the libraries jQuery
5 4
 (global => {
6 5
     // jQuery
7 6
     if (typeof global.$ === 'undefined') {
@@ -10,13 +9,6 @@ import './native';
10 9
         jQuery(global);
11 10
         global.$ = jQuery;
12 11
     }
13
-
14
-    // Strophe
15
-    if (typeof global.Strophe === 'undefined') {
16
-        require('strophe');
17
-        require('strophejs-plugins/disco/strophe.disco');
18
-        require('strophejs-plugins/caps/strophe.caps.jsonly');
19
-    }
20 12
 })(global || window || this); // eslint-disable-line no-invalid-this
21 13
 
22 14
 // Re-export JitsiMeetJS from the library lib-jitsi-meet to (the other features

+ 2
- 15
react/features/base/lib-jitsi-meet/native/polyfills-browser.js View File

@@ -143,24 +143,10 @@ function _visitNode(node, callback) {
143 143
             document.cookie = '';
144 144
         }
145 145
 
146
-        // Document.querySelector
147
-        //
148
-        // Required by:
149
-        // - strophejs-plugins/caps/strophe.caps.jsonly.js
150
-        const documentPrototype = Object.getPrototypeOf(document);
151
-
152
-        if (documentPrototype) {
153
-            if (typeof documentPrototype.querySelector === 'undefined') {
154
-                documentPrototype.querySelector = function(selectors) {
155
-                    return _querySelector(this.elementNode, selectors);
156
-                };
157
-            }
158
-        }
159
-
160 146
         // Element.querySelector
161 147
         //
162 148
         // Required by:
163
-        // - strophejs-plugins/caps/strophe.caps.jsonly.js
149
+        // - lib-jitsi-meet/modules/xmpp
164 150
         const elementPrototype
165 151
             = Object.getPrototypeOf(document.documentElement);
166 152
 
@@ -212,6 +198,7 @@ function _visitNode(node, callback) {
212 198
         // FIXME There is a weird infinite loop related to console.log and
213 199
         // Document and/or Element at the time of this writing. Work around it
214 200
         // by patching Node and/or overriding console.log.
201
+        const documentPrototype = Object.getPrototypeOf(document);
215 202
         const nodePrototype
216 203
             = _getCommonPrototype(documentPrototype, elementPrototype);
217 204
 

+ 2
- 2
react/features/base/participants/functions.js View File

@@ -1,4 +1,5 @@
1 1
 // @flow
2
+import md5 from 'js-md5';
2 3
 
3 4
 import { toState } from '../redux';
4 5
 
@@ -6,7 +7,6 @@ import { DEFAULT_AVATAR_RELATIVE_PATH } from './constants';
6 7
 
7 8
 declare var config: Object;
8 9
 declare var interfaceConfig: Object;
9
-declare var MD5: Object;
10 10
 
11 11
 /**
12 12
  * Returns the URL of the image for the avatar of a specific participant.
@@ -71,7 +71,7 @@ export function getAvatarURL({ avatarID, avatarURL, email, id }: {
71 71
         }
72 72
     }
73 73
 
74
-    return urlPrefix + MD5.hexdigest(key.trim().toLowerCase()) + urlSuffix;
74
+    return urlPrefix + md5.hex(key.trim().toLowerCase()) + urlSuffix;
75 75
 }
76 76
 
77 77
 /**

+ 1
- 15
webpack.config.js View File

@@ -24,7 +24,6 @@ const plugins = [
24 24
         minimize
25 25
     })
26 26
 ];
27
-const strophe = /\/node_modules\/strophe(js-plugins)?\/.*\.js$/;
28 27
 
29 28
 if (minimize) {
30 29
     // XXX Webpack's command line argument -p is not enough. Further
@@ -92,12 +91,6 @@ const config = {
92 91
 
93 92
             loader: 'expose-loader?$!expose-loader?jQuery',
94 93
             test: /\/node_modules\/jquery\/.*\.js$/
95
-        }, {
96
-            // Disable AMD for the Strophe.js library or its imports will fail
97
-            // at runtime.
98
-
99
-            loader: 'imports-loader?define=>false&this=>window',
100
-            test: strophe
101 94
         }, {
102 95
             // Set scope to window for URL polyfill.
103 96
 
@@ -122,14 +115,7 @@ const config = {
122 115
                 name: '[path][name].[ext]'
123 116
             },
124 117
             test: /\.(gif|png|svg)$/
125
-        } ],
126
-        noParse: [
127
-
128
-            // Do not parse the files of the Strophe.js library or at least
129
-            // parts of the properties of the Strophe global variable will be
130
-            // missing and strophejs-plugins will fail at runtime.
131
-            strophe
132
-        ]
118
+        } ]
133 119
     },
134 120
     node: {
135 121
         // Allow the use of the real filename of the module being executed. By

Loading…
Cancel
Save