lib/blather/stream.rb in blather-0.3.0 vs lib/blather/stream.rb in blather-0.3.1

- old
+ new

@@ -85,12 +85,12 @@ ## # Called by EM when the connection is closed def unbind # :nodoc: # @keepalive.cancel @state = :stopped - @client.call @error if @error - @client.stopped + @client.receive_data @error if @error + @client.unbind end ## # Called by the parser with parsed nodes def receive(node) # :nodoc: @@ -160,11 +160,11 @@ ## # Called when @state == :ready # Simply passes the stanza to the client def ready - @client.call @node.to_stanza + @client.receive_data @node.to_stanza end def handle_stream_error @error = StreamError.import @node stop @@ -240,10 +240,10 @@ def establish_session unless @session @session = Session.new self, @to # on success destroy the session object, let the client know the stream has been started # then continue the features dispatch process - @session.on_success { LOG.debug "SESSION: SUCCESS"; @session = nil; @client.stream_started(self); @state = :features; dispatch } + @session.on_success { LOG.debug "SESSION: SUCCESS"; @session = nil; @client.post_init; @state = :features; dispatch } # on failure end the stream @session.on_failure { |err| LOG.debug "SESSION: FAILURE"; @error = err; stop } @node = @features.shift end