Class: Kibosh::XMPP::Session
- Defined in:
- lib/kibosh/xmpp/session.rb,
lib/kibosh/xmpp/session/stream.rb
Defined Under Namespace
Modules: CreateSessionRequest Classes: Stream
Instance Attribute Summary
Attributes inherited from Session
Instance Method Summary collapse
- #handle(request, response) ⇒ Object
-
#initialize(request, response) ⇒ Session
constructor
A new instance of Session.
- #version ⇒ Object
Methods inherited from Session
#accept, #charsets, #defer, find, #hold, #inactivity, #maxpause, #polling, #requests, #respond, #stop, #streams, #ver, #wait
Constructor Details
Instance Method Details
#handle(request, response) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/kibosh/xmpp/session.rb', line 25 def handle request, response restart = (attr = request.body.attribute_with_ns("restart",'urn:xmpp:xbosh')) && attr.value == "true" if restart to = request.body["to"] request.body.remove_attribute "to" stream = streams[request] request.body["to"] = to if to stream.restart request, response else super end end |
#version ⇒ Object
21 22 23 |
# File 'lib/kibosh/xmpp/session.rb', line 21 def version @version ||= client[:version] end |