module Blather class Stream class Component < Stream NAMESPACE = 'jabber:component:accept' def receive(node) # :nodoc: if node.element_name == 'handshake' @client.stream_started(self) else super end if node.namespaces.find_by_href('http://etherx.jabber.org/streams') && node.find_first('/stream:stream[not(stream:error)]') send("#{Digest::SHA1.hexdigest(@node['id']+@pass)}") end end protected def start @parser = Parser.new self start_stream = <<-STREAM STREAM send start_stream.gsub(/\s+/, ' ') end end #Client end #Stream end #Blather