Sha256: 4399d81e21bf51a1172d23beba773074982e4eee163f3243ecdafdb6345cc2b6

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

# =XMPP4R - XMPP Library for Ruby
# License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
# Website::http://home.gna.org/xmpp4r/

module Jabber
  module Bytestreams
    ##
    # Implementation of IBB at the initiator side
    class IBBInitiator < IBB
      # You may set the block-size before open
      attr_accessor :block_size

      ##
      # Open the stream to the peer,
      # waits for successful result
      #
      # May throw ErrorException
      def open
        iq = Iq.new(:set, @peer_jid)
        open = iq.add REXML::Element.new('open')
        open.add_namespace IBB::NS_IBB
        open.attributes['sid'] = @session_id
        open.attributes['block-size'] = @block_size

        @stream.send_with_id(iq) { |answer|
          answer.type == :result
        }

        activate
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xmpp4r-0.3.1 lib/xmpp4r/bytestreams/helper/ibb/initiator.rb
xmpp4r-0.3.2 lib/xmpp4r/bytestreams/helper/ibb/initiator.rb