lib/blather/stream/component.rb in blather-0.8.1 vs lib/blather/stream/component.rb in blather-0.8.2

- old
+ new

@@ -11,28 +11,20 @@ else super end if node.document.find_first('/stream:stream[not(stream:error)]', :xmlns => NAMESPACE, :stream => STREAM_NS) - send("<handshake>#{Digest::SHA1.hexdigest(@node['id']+@password)}</handshake>") + send "<handshake>#{Digest::SHA1.hexdigest(node['id']+@password)}</handshake>" end end def send(stanza) stanza.from ||= self.jid if stanza.respond_to?(:from) && stanza.respond_to?(:from=) super stanza end def start - @parser = Parser.new self - start_stream = <<-STREAM - <stream:stream - to='#{@jid}' - xmlns='#{NAMESPACE}' - xmlns:stream='#{STREAM_NS}' - > - STREAM - send start_stream.gsub(/\s+/, ' ') + send "<stream:stream to='#{@jid}' xmlns='#{NAMESPACE}' xmlns:stream='#{STREAM_NS}'>" end end #Client end #Stream end #Blather