Sha256: db5f89b6917752416edac169ffee00c1d2db3f09a1f2e32f53f3d4e81dbc8920

Contents?: true

Size: 551 Bytes

Versions: 13

Compression:

Stored size: 551 Bytes

Contents

module Blather
class Stream

  # @private
  class Client < Stream
    LANG = 'en'
    VERSION = '1.0'
    NAMESPACE = 'jabber:client'

    def start
      @parser = Parser.new self
      send "<stream:stream to='#{@to}' xmlns='#{NAMESPACE}' xmlns:stream='#{STREAM_NS}' version='#{VERSION}' xml:lang='#{LANG}'>"
    end

    def send(stanza)
      stanza.from = self.jid if stanza.is_a?(Stanza) && !stanza.from.nil?
      super stanza
    end

    def cleanup
      @parser.finish if @parser
      super
    end
  end #Client

end #Stream
end #Blather

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
blather-2.0.0 lib/blather/stream/client.rb
blather-1.2.0 lib/blather/stream/client.rb
blather-1.1.4 lib/blather/stream/client.rb
blather-1.1.3 lib/blather/stream/client.rb
blather-1.1.2 lib/blather/stream/client.rb
blather-1.1.1 lib/blather/stream/client.rb
blather-1.1.0 lib/blather/stream/client.rb
blather-1.0.0 lib/blather/stream/client.rb
blather-0.8.8 lib/blather/stream/client.rb
blather-0.8.7 lib/blather/stream/client.rb
blather-0.8.6 lib/blather/stream/client.rb
blather-0.8.5 lib/blather/stream/client.rb
blather-0.8.4 lib/blather/stream/client.rb