Sha256: 9e19ac73c099275c10047fbe836d05efab1ee6829047ff8ef2189b5d8fd67a9c

Contents?: true

Size: 986 Bytes

Versions: 14

Compression:

Stored size: 986 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Send a direct invitation to several destinations.
    #
    # @see https://bit.ly/2wuTpr2
    class SendDirectInvitation
      # 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+)
      # @param users [Array<String>] user JIDs wo/ resource
      #   (eg. +tom@localhost+)
      # @param password [String] a optional room password
      # @param reason [String] the reason for the invitation
      def self.call(callable, room:, users:, password: '', reason: '')
        name, service = room.split('@')
        callable.call('send_direct_invitation',
                      name: name,
                      service: service,
                      password: password,
                      reason: reason,
                      users: users.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/send_direct_invitation.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/send_direct_invitation.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/send_direct_invitation.rb