Class: Blather::Stream::Session

Inherits:
Features
  • Object
show all
Defined in:
lib/blather/stream/features/session.rb

Constant Summary collapse

SESSION_NS =
'urn:ietf:params:xml:ns:xmpp-session'.freeze

Instance Method Summary collapse

Methods inherited from Features

#fail!, #feature?, from_namespace, #next!, register, #succeed!

Constructor Details

#initialize(stream, succeed, fail) ⇒ Session

Returns a new instance of Session.



9
10
11
12
# File 'lib/blather/stream/features/session.rb', line 9

def initialize(stream, succeed, fail)
  super
  @to = @stream.jid.domain
end

Instance Method Details

#receive_data(stanza) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/blather/stream/features/session.rb', line 14

def receive_data(stanza)
  @node = stanza
  case stanza.element_name
  when 'session'  then  session
  when 'iq'       then  check_response
  else                  fail!(UnknownResponse.new(stanza))
  end
end