Displays error dialog when BOSH connection fails.
This commit is contained in:
parent
667f67376e
commit
8af3a65d37
|
@ -19,7 +19,7 @@
|
||||||
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
|
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
|
||||||
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
|
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
|
||||||
<script src="interface_config.js?v=5"></script>
|
<script src="interface_config.js?v=5"></script>
|
||||||
<script src="libs/app.bundle.js?v=61"></script>
|
<script src="libs/app.bundle.js?v=62"></script>
|
||||||
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
|
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
|
||||||
<link rel="stylesheet" href="css/font.css?v=7"/>
|
<link rel="stylesheet" href="css/font.css?v=7"/>
|
||||||
<link rel="stylesheet" href="css/toastr.css?v=1">
|
<link rel="stylesheet" href="css/toastr.css?v=1">
|
||||||
|
|
|
@ -134,6 +134,7 @@
|
||||||
"passwordError2": "This conversation isn't currently protected by a password. Only the owner of the conference could set a password.",
|
"passwordError2": "This conversation isn't currently protected by a password. Only the owner of the conference could set a password.",
|
||||||
"joinError": "Oops! We couldn't join the conference. There might be some problem with security configuration. Please contact service administrator.",
|
"joinError": "Oops! We couldn't join the conference. There might be some problem with security configuration. Please contact service administrator.",
|
||||||
"connectError": "Oops! Something went wrong and we couldn't connect to the conference.",
|
"connectError": "Oops! Something went wrong and we couldn't connect to the conference.",
|
||||||
|
"connectErrorWithMsg": "Oops! Something went wrong and we couldn't connect to the conference: __msg__",
|
||||||
"connecting": "Connecting",
|
"connecting": "Connecting",
|
||||||
"error": "Error",
|
"error": "Error",
|
||||||
"detectext": "Error when trying to detect desktopsharing extension.",
|
"detectext": "Error when trying to detect desktopsharing extension.",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -77,9 +77,27 @@ function streamHandler(stream, isMuted) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onXmppConnectionFailed(stropheErrorMsg) {
|
||||||
|
|
||||||
|
var title = APP.translation.generateTranslatonHTML(
|
||||||
|
"dialog.error");
|
||||||
|
|
||||||
|
var message;
|
||||||
|
if (stropheErrorMsg) {
|
||||||
|
message = APP.translation.generateTranslatonHTML(
|
||||||
|
"dialog.connectErrorWithMsg", {msg: stropheErrorMsg});
|
||||||
|
} else {
|
||||||
|
message = APP.translation.generateTranslatonHTML(
|
||||||
|
"dialog.connectError");
|
||||||
|
}
|
||||||
|
|
||||||
|
messageHandler.openDialog(
|
||||||
|
title, message, true, {}, function (e, v, m, f) { return false; });
|
||||||
|
}
|
||||||
|
|
||||||
function onDisposeConference(unload) {
|
function onDisposeConference(unload) {
|
||||||
Toolbar.showAuthenticateButton(false);
|
Toolbar.showAuthenticateButton(false);
|
||||||
};
|
}
|
||||||
|
|
||||||
function onDisplayNameChanged(jid, displayName) {
|
function onDisplayNameChanged(jid, displayName) {
|
||||||
ContactList.onDisplayNameChange(jid, displayName);
|
ContactList.onDisplayNameChange(jid, displayName);
|
||||||
|
@ -149,6 +167,7 @@ function registerListeners() {
|
||||||
VideoLayout.updateConnectionStats);
|
VideoLayout.updateConnectionStats);
|
||||||
APP.connectionquality.addListener(CQEvents.STOP,
|
APP.connectionquality.addListener(CQEvents.STOP,
|
||||||
VideoLayout.onStatsStop);
|
VideoLayout.onStatsStop);
|
||||||
|
APP.xmpp.addListener(XMPPEvents.CONNECTION_FAILED, onXmppConnectionFailed);
|
||||||
APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
|
APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
|
||||||
APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
|
APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
|
||||||
messageHandler.openMessageDialog(
|
messageHandler.openMessageDialog(
|
||||||
|
|
|
@ -42,10 +42,15 @@ function connect(jid, password) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var anonymousConnectionFailed = false;
|
var anonymousConnectionFailed = false;
|
||||||
|
var wasConnected = false;
|
||||||
|
var lastErrorMsg;
|
||||||
connection.connect(jid, password, function (status, msg) {
|
connection.connect(jid, password, function (status, msg) {
|
||||||
console.log('Strophe status changed to',
|
console.log('Strophe status changed to',
|
||||||
Strophe.getStatusString(status));
|
Strophe.getStatusString(status), msg);
|
||||||
if (status === Strophe.Status.CONNECTED) {
|
if (status === Strophe.Status.CONNECTED) {
|
||||||
|
|
||||||
|
wasConnected = true;
|
||||||
|
|
||||||
if (config.useStunTurn) {
|
if (config.useStunTurn) {
|
||||||
connection.jingle.getStunAndTurnCredentials();
|
connection.jingle.getStunAndTurnCredentials();
|
||||||
}
|
}
|
||||||
|
@ -59,10 +64,15 @@ function connect(jid, password) {
|
||||||
if (msg === 'x-strophe-bad-non-anon-jid') {
|
if (msg === 'x-strophe-bad-non-anon-jid') {
|
||||||
anonymousConnectionFailed = true;
|
anonymousConnectionFailed = true;
|
||||||
}
|
}
|
||||||
|
lastErrorMsg = msg;
|
||||||
} else if (status === Strophe.Status.DISCONNECTED) {
|
} else if (status === Strophe.Status.DISCONNECTED) {
|
||||||
if (anonymousConnectionFailed) {
|
if (anonymousConnectionFailed) {
|
||||||
// prompt user for username and password
|
// prompt user for username and password
|
||||||
XMPP.promptLogin();
|
XMPP.promptLogin();
|
||||||
|
} else if (!wasConnected) {
|
||||||
|
eventEmitter.emit(
|
||||||
|
XMPPEvents.CONNECTION_FAILED,
|
||||||
|
msg ? msg : lastErrorMsg);
|
||||||
}
|
}
|
||||||
} else if (status === Strophe.Status.AUTHFAIL) {
|
} else if (status === Strophe.Status.AUTHFAIL) {
|
||||||
// wrong password or username, prompt user
|
// wrong password or username, prompt user
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var XMPPEvents = {
|
var XMPPEvents = {
|
||||||
|
CONNECTION_FAILED: "xmpp.connection.failed",
|
||||||
CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
|
CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
|
||||||
CALL_TERMINATED: "xmpp.callterminated.jingle",
|
CALL_TERMINATED: "xmpp.callterminated.jingle",
|
||||||
CALL_INCOMING: "xmpp.callincoming.jingle",
|
CALL_INCOMING: "xmpp.callincoming.jingle",
|
||||||
|
|
Loading…
Reference in New Issue