strophe/strophejs — pull request #42 by Gordin (2013-11-17 16:41:32+00:00)
Title: Fix broken sorting of Authentication Mechanisms and fix for Error Handling in WebSockets

The "pluggable auth" patch (strophe/strophejs#1) completely broke the ordering and priorities of Authentication mechanisms.
1. All mechanisms except ANONYMOUS were set to the same priority
2. The sorting for the mechanisms basically compared undefined with undefined to determine which mechanism-priority was higher and also did not sort anything anyway because the swapping condition was "current element index > array length"...
Basically Strophe always used the first mechanism the server offered. I noticed this because my client was using PLAIN.
Changes to core.js fix this. Mechanism order is now SCRAM > MD5 > PLAIN.
(Just making this pull request instead of pushing so people who watch this repo and use the latest git version get a notification for this...)

Changes in websocket.js fix a parsing issue with stream errors that do not contain child elements.