Browse Source

handle DTMF_SUPPORT_CHANGED event

master
isymchych 9 years ago
parent
commit
eeb390cd9d
3 changed files with 15 additions and 21 deletions
  1. 8
    10
      app.js
  2. 2
    2
      modules/RoomLocker.js
  3. 5
    9
      modules/UI/UI.js

+ 8
- 10
app.js View File

343
         room.setDisplayName(nickname);
343
         room.setDisplayName(nickname);
344
     });
344
     });
345
 
345
 
346
-    room.on(ConferenceErrors.PASSWORD_REQUIRED, function () {
347
-        // FIXME handle
348
-    });
349
     room.on(ConferenceErrors.CONNECTION_ERROR, function () {
346
     room.on(ConferenceErrors.CONNECTION_ERROR, function () {
350
         // FIXME handle
347
         // FIXME handle
351
     });
348
     });
366
         );
363
         );
367
     });
364
     });
368
 
365
 
366
+    room.on(ConferenceEvents.DTMF_SUPPORT_CHANGED, function (isDTMFSupported) {
367
+        APP.UI.updateDTMFSupport(isDTMFSupported);
368
+    });
369
+
369
     return new Promise(function (resolve, reject) {
370
     return new Promise(function (resolve, reject) {
370
         room.on(ConferenceEvents.CONFERENCE_JOINED, resolve);
371
         room.on(ConferenceEvents.CONFERENCE_JOINED, resolve);
371
 
372
 
372
-        room.on(ConferenceErrors.ROOM_PASSWORD_REQUIRED, function () {
373
+        room.on(ConferenceErrors.PASSWORD_REQUIRED, function () {
373
             APP.UI.markRoomLocked(true);
374
             APP.UI.markRoomLocked(true);
374
             roomLocker.requirePassword().then(function () {
375
             roomLocker.requirePassword().then(function () {
375
                 room.join(roomLocker.password);
376
                 room.join(roomLocker.password);
376
             });
377
             });
377
         });
378
         });
378
 
379
 
380
+        // FIXME handle errors here
381
+
379
         APP.UI.closeAuthenticationDialog();
382
         APP.UI.closeAuthenticationDialog();
380
         room.join();
383
         room.join();
381
     }).catch(function (err) {
384
     }).catch(function (err) {
382
-        if (err[0] === ConferenceErrors.PASSWORD_REQUIRED) {
383
-            // FIXME ask for password and try again
384
-            return initConference(localTracks, connection);
385
-        }
386
-
387
-        // FIXME else notify that we cannot conenct to the room
385
+        // FIXME notify that we cannot conenct to the room
388
 
386
 
389
         throw new Error(err[0]);
387
         throw new Error(err[0]);
390
     });
388
     });

+ 2
- 2
modules/RoomLocker.js View File

83
     messageHandler.showError("dialog.lockTitle", "dialog.lockMessage");
83
     messageHandler.showError("dialog.lockTitle", "dialog.lockMessage");
84
 }
84
 }
85
 
85
 
86
-const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
86
+const ConferenceErrors = JitsiMeetJS.errors.conference;
87
 
87
 
88
 export default function createRoomLocker (room) {
88
 export default function createRoomLocker (room) {
89
     let password;
89
     let password;
92
         return room.lock(newPass).then(function () {
92
         return room.lock(newPass).then(function () {
93
             password = newPass;
93
             password = newPass;
94
         }).catch(function (err) {
94
         }).catch(function (err) {
95
-            if (err === JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED) {
95
+            if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) {
96
                 notifyPasswordNotSupported();
96
                 notifyPasswordNotSupported();
97
             } else {
97
             } else {
98
                 notifyPasswordFailed(err);
98
                 notifyPasswordFailed(err);

+ 5
- 9
modules/UI/UI.js View File

316
     Etherpad.init(name);
316
     Etherpad.init(name);
317
 }
317
 }
318
 
318
 
319
-/**
320
- * The dialpad button is shown iff there is at least one member that supports
321
- * DTMF (e.g. jigasi).
322
- */
323
-function onDtmfSupportChanged(dtmfSupport) {
324
-    //TODO: enable when the UI is ready
325
-    //Toolbar.showDialPadButton(dtmfSupport);
326
-}
327
-
328
 UI.addUser = function (jid, id, displayName) {
319
 UI.addUser = function (jid, id, displayName) {
329
     messageHandler.notify(
320
     messageHandler.notify(
330
         displayName,'notify.somebody', 'connected', 'notify.connected'
321
         displayName,'notify.somebody', 'connected', 'notify.connected'
621
     Chat.updateChatConversation(from, displayName, message, stamp);
612
     Chat.updateChatConversation(from, displayName, message, stamp);
622
 };
613
 };
623
 
614
 
615
+UI.updateDTMFSupport = function (isDTMFSupported) {
616
+    //TODO: enable when the UI is ready
617
+    //Toolbar.showDialPadButton(dtmfSupport);
618
+};
619
+
624
 module.exports = UI;
620
 module.exports = UI;

Loading…
Cancel
Save