Sha256: 44b8142e1b4995998ddd10b2a82d479495d977e1f6f99e125ba8db9b3302dfd9

Contents?: true

Size: 806 Bytes

Versions: 14

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Create a new room (MUC).
    #
    # @see https://bit.ly/2rB8DFR
    class CreateRoom
      # Pass the correct data to the given callable.
      #
      # *Note:* this command should not be used in the bang-variant, due to raw
      # result string in the response. (the response body is not zero/one like
      # on almost all commands)
      #
      # @param callable [Proc, #call] the callable to call
      # @param room [String] room JID (eg. +room1@conference.localhost+)
      # @param host [String] the jabber host (eg. +localhost+)
      def self.call(callable, room:, host:)
        name, service = room.split('@')
        callable.call('create_room', name: name, service: service, host: host)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jabber_admin-1.3.4 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/create_room.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/create_room.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/create_room.rb