Sha256: dc7f593bfdfebe4476bbbf6e040f5d12ad8aa878d4ac190334dafc7bf2d43dff

Contents?: true

Size: 913 Bytes

Versions: 14

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Change a user affiliation in a MUC room. (eg. allow him to enter a
    # members-only room)
    #
    # @see https://bit.ly/2G5MfbW
    class SetRoomAffiliation
      # Pass the correct data to the given callable.
      #
      # @param callable [Proc, #call] the callable to call
      # @param user [String] user JID wo/ resource (eg. +tom@localhost+)
      # @param room [String] room JID (eg. +room1@conference.localhost+)
      # @param affiliation [String] the MUC/user affiliation (eg. +member+)
      def self.call(callable, user:, room:, affiliation: 'member')
        name, service = room.split('@')
        callable.call('set_room_affiliation',
                      name: name,
                      service: service,
                      jid: user,
                      affiliation: affiliation)
      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/set_room_affiliation.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/set_room_affiliation.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/set_room_affiliation.rb