Displays error dialog when BOSH connection fails.

This commit is contained in:
paweldomas 2015-04-22 16:14:16 +02:00
parent 667f67376e
commit 8af3a65d37
6 changed files with 18957 additions and 18895 deletions

View File

@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<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 -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@ -134,6 +134,7 @@
"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.",
"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",
"error": "Error",
"detectext": "Error when trying to detect desktopsharing extension.",

File diff suppressed because it is too large Load Diff

View File

@ -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) {
Toolbar.showAuthenticateButton(false);
};
}
function onDisplayNameChanged(jid, displayName) {
ContactList.onDisplayNameChange(jid, displayName);
@ -149,6 +167,7 @@ function registerListeners() {
VideoLayout.updateConnectionStats);
APP.connectionquality.addListener(CQEvents.STOP,
VideoLayout.onStatsStop);
APP.xmpp.addListener(XMPPEvents.CONNECTION_FAILED, onXmppConnectionFailed);
APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
messageHandler.openMessageDialog(

View File

@ -42,27 +42,37 @@ function connect(jid, password) {
}
var anonymousConnectionFailed = false;
var wasConnected = false;
var lastErrorMsg;
connection.connect(jid, password, function (status, msg) {
console.log('Strophe status changed to',
Strophe.getStatusString(status));
Strophe.getStatusString(status), msg);
if (status === Strophe.Status.CONNECTED) {
wasConnected = true;
if (config.useStunTurn) {
connection.jingle.getStunAndTurnCredentials();
}
console.info("My Jabber ID: " + connection.jid);
if(password)
if (password)
authenticatedUser = true;
maybeDoJoin();
} else if (status === Strophe.Status.CONNFAIL) {
if(msg === 'x-strophe-bad-non-anon-jid') {
if (msg === 'x-strophe-bad-non-anon-jid') {
anonymousConnectionFailed = true;
}
lastErrorMsg = msg;
} else if (status === Strophe.Status.DISCONNECTED) {
if(anonymousConnectionFailed) {
if (anonymousConnectionFailed) {
// prompt user for username and password
XMPP.promptLogin();
} else if (!wasConnected) {
eventEmitter.emit(
XMPPEvents.CONNECTION_FAILED,
msg ? msg : lastErrorMsg);
}
} else if (status === Strophe.Status.AUTHFAIL) {
// wrong password or username, prompt user

View File

@ -1,4 +1,5 @@
var XMPPEvents = {
CONNECTION_FAILED: "xmpp.connection.failed",
CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
CALL_TERMINATED: "xmpp.callterminated.jingle",
CALL_INCOMING: "xmpp.callincoming.jingle",