Sha256: 8444ce51647bd0764ae1d2ab4f545afa3576040b65e9d985d6d8b892463593a6

Contents?: true

Size: 622 Bytes

Versions: 22

Compression:

Stored size: 622 Bytes

Contents

module Blather
class Stream

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

    def start
      @parser = Parser.new self
      start_stream = <<-STREAM
        <stream:stream
          to='#{@to}'
          xmlns='#{NAMESPACE}'
          xmlns:stream='#{STREAM_NS}'
          version='#{VERSION}'
          xml:lang='#{LANG}'
        >
      STREAM
      send start_stream.gsub(/\s+/, ' ')
    end

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

  end #Client

end #Stream
end #Blather

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
tp-blather-0.8.5 lib/blather/stream/client.rb
tp-blather-0.8.4 lib/blather/stream/client.rb
tp-blather-0.8.3 lib/blather/stream/client.rb
tp-blather-0.8.2 lib/blather/stream/client.rb
blather-0.8.1 lib/blather/stream/client.rb
blather-0.8.0 lib/blather/stream/client.rb
blather-0.7.1 lib/blather/stream/client.rb
blather-0.7.0 lib/blather/stream/client.rb
blather-0.6.2 lib/blather/stream/client.rb
blather-0.6.1 lib/blather/stream/client.rb
blather-0.6.0 lib/blather/stream/client.rb
blather-0.5.12 lib/blather/stream/client.rb
blather-0.5.11 lib/blather/stream/client.rb
blather-0.5.10 lib/blather/stream/client.rb
blather-0.5.9 lib/blather/stream/client.rb
blather-0.5.8 lib/blather/stream/client.rb
blather-0.5.7 lib/blather/stream/client.rb
blather-0.5.6 lib/blather/stream/client.rb
blather-0.5.4 lib/blather/stream/client.rb
blather-0.5.3 lib/blather/stream/client.rb