Sha256: 7fc3eb8648d1f42f1a706a7c7983258ba360b18bb0c17db9cc7a6fd2432a66b6
Contents?: true
Size: 888 Bytes
Versions: 24
Compression:
Stored size: 888 Bytes
Contents
module Blather class Stream class Component < Stream NAMESPACE = 'jabber:component:accept' def receive(node) # :nodoc: if node.element_name == 'handshake' ready! 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>") 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+/, ' ') end end #Client end #Stream end #Blather
Version data entries
24 entries across 24 versions & 3 rubygems
Version | Path |
---|---|
blather-0.4.3 | lib/blather/stream/component.rb |
blather-0.4.1 | lib/blather/stream/component.rb |
blather-0.4.0 | lib/blather/stream/component.rb |
blather-0.4.2 | lib/blather/stream/component.rb |