Skip to content

Commit c619157

Browse files
committed
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
1 parent c848d19 commit c619157

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,11 @@ Strophe.Connection.prototype = {
29562956
{
29572957
if (elem.getAttribute("type") == "error") {
29582958
Strophe.info("SASL binding failed.");
2959-
this._changeConnectStatus(Strophe.Status.AUTHFAIL, null);
2959+
var conflict = elem.getElementsByTagName("conflict"), condition;
2960+
if (conflict.length > 0) {
2961+
condition = 'conflict';
2962+
}
2963+
this._changeConnectStatus(Strophe.Status.AUTHFAIL, condition);
29602964
return false;
29612965
}
29622966

0 commit comments

Comments
 (0)