Sha256: f77272cb89d1d143c026803451a613a94003298729e5497ac7ae48d4af3a0f30

Contents?: true

Size: 609 Bytes

Versions: 20

Compression:

Stored size: 609 Bytes

Contents

module Blather
class Stream

  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

20 entries across 20 versions & 3 rubygems

Version Path
sprsquish-blather-0.4.2 lib/blather/stream/client.rb
sprsquish-blather-0.4.3 lib/blather/stream/client.rb
sprsquish-blather-0.4.4 lib/blather/stream/client.rb
blather-0.4.16 lib/blather/stream/client.rb
blather-0.4.15 lib/blather/stream/client.rb
shingara-blather-0.4.14 lib/blather/stream/client.rb
blather-0.4.14 lib/blather/stream/client.rb
blather-0.4.13 lib/blather/stream/client.rb
blather-0.4.12 lib/blather/stream/client.rb
blather-0.4.11 lib/blather/stream/client.rb
blather-0.4.10 lib/blather/stream/client.rb
shingara-blather-0.4.9 lib/blather/stream/client.rb
shingara-blather-0.4.8 lib/blather/stream/client.rb
blather-0.4.8 lib/blather/stream/client.rb
blather-0.4.7 lib/blather/stream/client.rb
blather-0.4.6 lib/blather/stream/client.rb
blather-0.4.5 lib/blather/stream/client.rb
blather-0.4.4 lib/blather/stream/client.rb
blather-0.4.3 lib/blather/stream/client.rb
blather-0.4.2 lib/blather/stream/client.rb