Преглед изворни кода

Adjusts anonymous domain functionality to work with Jicofo.

j8
paweldomas пре 10 година
родитељ
комит
d3003d4fcd
2 измењених фајлова са 23 додато и 4 уклоњено
  1. 11
    1
      moderator.js
  2. 12
    3
      muc.js

+ 11
- 1
moderator.js Прегледај датотеку

@@ -190,7 +190,17 @@ var Moderator = (function (my) {
190 190
                 // Not authorized to create new room
191 191
                 if ($(error).find('>error>not-authorized').length) {
192 192
                     console.warn("Unauthorized to start the conference");
193
-                    UI.onAuthenticationRequired();
193
+                    var toDomain
194
+                        = Strophe.getDomainFromJid(error.getAttribute('to'));
195
+                    if (toDomain === config.hosts.anonymousdomain) {
196
+                        // we are connected with anonymous domain and
197
+                        // only non anonymous users can create rooms
198
+                        // we must authorize the user
199
+                        $(document).trigger('passwordrequired.main');
200
+                    } else {
201
+                        // External authentication mode
202
+                        UI.onAuthenticationRequired();
203
+                    }
194 204
                     return;
195 205
                 }
196 206
                 var waitMs = getNextErrorTimeout();

+ 12
- 3
muc.js Прегледај датотеку

@@ -255,9 +255,18 @@ Strophe.addConnectionPlugin('emuc', {
255 255
                 '>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
256 256
             var toDomain = Strophe.getDomainFromJid(pres.getAttribute('to'));
257 257
             if(toDomain === config.hosts.anonymousdomain) {
258
-                // we are connected with anonymous domain and only non anonymous users can create rooms
259
-                // we must authorize the user
260
-                $(document).trigger('passwordrequired.main');
258
+                // We are connected with anonymous domain and only non anonymous
259
+                // users can create rooms, but focus should not allow us to
260
+                // enter the room by replying with 'not-authorized'. This would
261
+                // result in reconnection from authorized domain.
262
+                // We're either missing Jicofo/Prosody config for anonymous
263
+                // domains or something is wrong.
264
+                //$(document).trigger('passwordrequired.main');
265
+                UI.messageHandler.openReportDialog(null,
266
+                    'Oops ! We couldn`t join the conference.' +
267
+                    ' There might be some problem with security' +
268
+                    ' configuration. Please contact service' +
269
+                    ' administrator.', pres);
261 270
             } else {
262 271
                 console.warn('onPresError ', pres);
263 272
                 UI.messageHandler.openReportDialog(null,

Loading…
Откажи
Сачувај