var roster = new Array();
function log(msg) {
- var entry = $('<div></div>').append(Strophe.xmlTextNode(msg));
+ var entry = $('<div></div>').append(document.createTextNode(msg));
$('#log').append(entry);
}
function onConnect(status) {
if (status == Strophe.Status.CONNECTING) {
log('Strophe is connecting.');
-
} else if (status == Strophe.Status.CONNFAIL) {
log('Strophe failed to connect.');
showConnect();
} else if (status == Strophe.Status.DISCONNECTED) {
log('Strophe is disconnected.');
showConnect();
-
+ } else if (status == Strophe.Status.AUTHFAIL) {
+ log('Authentication failed.');
+ connection.disconnect();
+ showConnect();
} else if (status == Strophe.Status.CONNECTED) {
log('Strophe is connected.');
getOwnInfo();