Skip to content

Commit

Permalink
Check for resource conflict during binding process and pass conflict …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
lboynton committed Aug 31, 2011
1 parent c848d19 commit c619157
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core.js
Expand Up @@ -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;
}

Expand Down

0 comments on commit c619157

Please sign in to comment.