Sha256: e0de75819141c11d14348f83355b5148a5e07ec2d33bce355413777802e834d6

Contents?: true

Size: 724 Bytes

Versions: 8

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Get room affiliations.
    #
    # @see https://bit.ly/3qI9Nyq
    class GetRoomAffiliations
      # Pass the correct data to the given callable.
      #
      # @param callable [Proc, #call] the callable to call
      # @param room [String] room JID (eg. +room1@conference.localhost+)
      def self.call(callable, room:)
        name, service = room.split('@')
        res = callable.call('get_room_affiliations', check_res_body: false,
                                                     name: name,
                                                     service: service)

        res.body ? JSON.parse(res.body) : nil
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jabber_admin-1.3.4 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/get_room_affiliations.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/get_room_affiliations.rb