From 9c8e638b6a3ff798e86cdfc576336ad4faced97c Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Fri, 5 Jun 2009 16:31:50 +0200 Subject: [PATCH] Handle Authentication and update to latest Stropejs version * AUTHFAIL state is now handled * Strophejs updated to latest git --- scripts/basic.js | 8 +++++--- scripts/strophejs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/basic.js b/scripts/basic.js index 4fb36fa..a4b4a18 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -13,7 +13,7 @@ var appName = 'socialXMPP'; var roster = new Array(); function log(msg) { - var entry = $('
').append(Strophe.xmlTextNode(msg)); + var entry = $('
').append(document.createTextNode(msg)); $('#log').append(entry); } @@ -257,7 +257,6 @@ function _cbPEP(e) { function onConnect(status) { if (status == Strophe.Status.CONNECTING) { log('Strophe is connecting.'); - } else if (status == Strophe.Status.CONNFAIL) { log('Strophe failed to connect.'); showConnect(); @@ -266,7 +265,10 @@ function onConnect(status) { } 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(); diff --git a/scripts/strophejs b/scripts/strophejs index f31e73f..76af4af 160000 --- a/scripts/strophejs +++ b/scripts/strophejs @@ -1 +1 @@ -Subproject commit f31e73fd12ca779b6cd93043496eda001e3b1aee +Subproject commit 76af4af579d71ded60a18e84ea99333b98c8e2d2 -- 2.39.5