From c61915703bd3c8eb43f18ae42d24f7d8350890b7 Mon Sep 17 00:00:00 2001 From: lboynton Date: Tue, 16 Aug 2011 11:57:08 +0100 Subject: [PATCH] Check for resource conflict during binding process and pass conflict as argument to the AUTHFAIL event. This caters for servers implementing case #3 in the XMPP spec in the following section: http://xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-08.html#bind-clientsubmit-error-conflict --- src/core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index 9a66899c..0a858747 100644 --- a/src/core.js +++ b/src/core.js @@ -2956,7 +2956,11 @@ Strophe.Connection.prototype = { { if (elem.getAttribute("type") == "error") { Strophe.info("SASL binding failed."); - this._changeConnectStatus(Strophe.Status.AUTHFAIL, null); + var conflict = elem.getElementsByTagName("conflict"), condition; + if (conflict.length > 0) { + condition = 'conflict'; + } + this._changeConnectStatus(Strophe.Status.AUTHFAIL, condition); return false; }