diff --git a/app.js b/app.js index c78395e36..4465f445e 100644 --- a/app.js +++ b/app.js @@ -343,9 +343,6 @@ function initConference(localTracks, connection) { room.setDisplayName(nickname); }); - room.on(ConferenceErrors.PASSWORD_REQUIRED, function () { - // FIXME handle - }); room.on(ConferenceErrors.CONNECTION_ERROR, function () { // FIXME handle }); @@ -366,25 +363,26 @@ function initConference(localTracks, connection) { ); }); + room.on(ConferenceEvents.DTMF_SUPPORT_CHANGED, function (isDTMFSupported) { + APP.UI.updateDTMFSupport(isDTMFSupported); + }); + return new Promise(function (resolve, reject) { room.on(ConferenceEvents.CONFERENCE_JOINED, resolve); - room.on(ConferenceErrors.ROOM_PASSWORD_REQUIRED, function () { + room.on(ConferenceErrors.PASSWORD_REQUIRED, function () { APP.UI.markRoomLocked(true); roomLocker.requirePassword().then(function () { room.join(roomLocker.password); }); }); + // FIXME handle errors here + APP.UI.closeAuthenticationDialog(); room.join(); }).catch(function (err) { - if (err[0] === ConferenceErrors.PASSWORD_REQUIRED) { - // FIXME ask for password and try again - return initConference(localTracks, connection); - } - - // FIXME else notify that we cannot conenct to the room + // FIXME notify that we cannot conenct to the room throw new Error(err[0]); }); diff --git a/modules/RoomLocker.js b/modules/RoomLocker.js index 920f6dc97..7b6c7acbf 100644 --- a/modules/RoomLocker.js +++ b/modules/RoomLocker.js @@ -83,7 +83,7 @@ function notifyPasswordFailed() { messageHandler.showError("dialog.lockTitle", "dialog.lockMessage"); } -const JitsiConferenceErrors = JitsiMeetJS.errors.conference; +const ConferenceErrors = JitsiMeetJS.errors.conference; export default function createRoomLocker (room) { let password; @@ -92,7 +92,7 @@ export default function createRoomLocker (room) { return room.lock(newPass).then(function () { password = newPass; }).catch(function (err) { - if (err === JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED) { + if (err === ConferenceErrors.PASSWORD_NOT_SUPPORTED) { notifyPasswordNotSupported(); } else { notifyPasswordFailed(err); diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 6af3dbcb0..4177a8b7d 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -316,15 +316,6 @@ function initEtherpad(name) { Etherpad.init(name); } -/** - * The dialpad button is shown iff there is at least one member that supports - * DTMF (e.g. jigasi). - */ -function onDtmfSupportChanged(dtmfSupport) { - //TODO: enable when the UI is ready - //Toolbar.showDialPadButton(dtmfSupport); -} - UI.addUser = function (jid, id, displayName) { messageHandler.notify( displayName,'notify.somebody', 'connected', 'notify.connected' @@ -621,4 +612,9 @@ UI.addMessage = function (from, displayName, message, stamp) { Chat.updateChatConversation(from, displayName, message, stamp); }; +UI.updateDTMFSupport = function (isDTMFSupported) { + //TODO: enable when the UI is ready + //Toolbar.showDialPadButton(dtmfSupport); +}; + module.exports = UI;