Sha256: 3335267aae22698c95dc1e286dee695aebc05684e2175478de93bada04bd5d7b

Contents?: true

Size: 1005 Bytes

Versions: 14

Compression:

Stored size: 1005 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Subscribe to a MUC conference, via the mucsub feature.
    #
    # @see https://bit.ly/2Ke7Zoy
    class SubscribeRoom
      # Pass the correct data to the given callable.
      #
      # @param callable [Proc, #call] the callable to call
      # @param user [String] user JID w/ resource (eg. +tom@localhost/dummy+)
      # @param nick [String] the user nickname (eg. +TomTom+)
      # @param room [String] room JID (eg. +room1@conference.localhost+)
      # @param nodes [Array<String>] nodes comma separated
      #   (eg. +urn:xmpp:mucsub:nodes:messages+,
      #   +urn:xmpp:mucsub:nodes:affiliations+)
      def self.call(callable, user:, nick:, room:, nodes: [])
        callable.call('subscribe_room',
                      check_res_body: false,
                      user: user,
                      nick: nick,
                      room: room,
                      nodes: nodes.join(','))
      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/subscribe_room.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/subscribe_room.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/subscribe_room.rb