Class: Blather::Stream::Client

Inherits:
Blather::Stream show all
Defined in:
lib/blather/stream/client.rb

Constant Summary collapse

LANG =
'en'
VERSION =
'1.0'
NAMESPACE =
'jabber:client'

Constants inherited from Blather::Stream

STREAM_NS

Instance Attribute Summary

Attributes inherited from Blather::Stream

#authcid, #jid, #password

Instance Method Summary collapse

Methods inherited from Blather::Stream

connect, #connection_completed, #initialize, #post_init, #receive, #receive_data, #ssl_verify_peer, start, #unbind

Constructor Details

This class inherits a constructor from Blather::Stream

Instance Method Details

#cleanupObject



20
21
22
23
# File 'lib/blather/stream/client.rb', line 20

def cleanup
  @parser.finish if @parser
  super
end

#send(stanza) ⇒ Object



15
16
17
18
# File 'lib/blather/stream/client.rb', line 15

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

#startObject



10
11
12
13
# File 'lib/blather/stream/client.rb', line 10

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