<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+v0.4.6
+	Bugfix: prioritize authentication mechanisms
+
 v0.4.5
 	Bugfix: Change DSL#write to DSL#write_to_stream. Previous way was messing with YAML
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -80,7 +80,7 @@ module Blather
     # Called by EM with data from the wire
     def receive_data(data) # :nodoc:
       Blather.logger.debug &quot;\n#{'-'*30}\n&quot;
-      Blather.logger.debug &quot;&lt;&lt; #{data}&quot;
+      Blather.logger.debug &quot;STREAM IN: #{data}&quot;
       @parser &lt;&lt; data
 
     rescue ParseError =&gt; e</diff>
      <filename>lib/blather/stream.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,12 @@ class Stream # :nodoc:
       register :sasl_unknown_mechanism
     end
 
+    MECHANISMS = %w[
+      digest-md5
+      plain
+      anonymous
+    ].freeze
+
     SASL_NS = 'urn:ietf:params:xml:ns:xmpp-sasl'.freeze
     register SASL_NS
 
@@ -20,7 +26,8 @@ class Stream # :nodoc:
       @node = stanza
       case stanza.element_name
       when 'mechanisms'
-        @mechanisms = stanza.children.map { |m| m.content.downcase }
+        available_mechanisms = stanza.children.map { |m| m.content.downcase }
+        @mechanisms = MECHANISMS.select { |m| available_mechanisms.include? m }
         next!
       when 'failure'
         next!</diff>
      <filename>lib/blather/stream/features/sasl.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2715188243d55dad808266a0736cd0212b8ec939</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Smick</name>
    <email>sprsquish@gmail.com</email>
  </author>
  <url>http://github.com/sprsquish/blather/commit/64374151f273b7f7de3db4e20d7a404ada483447</url>
  <id>64374151f273b7f7de3db4e20d7a404ada483447</id>
  <committed-date>2009-10-30T11:11:02-07:00</committed-date>
  <authored-date>2009-10-30T10:45:52-07:00</authored-date>
  <message>Set a priority for authentication mechanisms (digest-md5, plain, anonymous)

This way we don't have to worry about what order the mechanisms are in when
sent from the server.</message>
  <tree>1a614b867b53018bb861cb49c27529f254023906</tree>
  <committer>
    <name>Jeff Smick</name>
    <email>sprsquish@gmail.com</email>
  </committer>
</commit>
