Sha256: 6cd595f94b1d1ab63019c908896ff9971996287a04c4ed66b609ca31de0321d6

Contents?: true

Size: 761 Bytes

Versions: 14

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Register a new user on the XMPP service.
    #
    # @see https://bit.ly/2wyhAox
    class Register
      # 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 password [String] the new plain password for the user
      #   (eg. +secret+)
      def self.call(callable, user:, password:)
        uid, host = user.split('@')
        callable.call('register',
                      check_res_body: false,
                      user: uid,
                      host: host,
                      password: password)
      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/register.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/register.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/register.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/register.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/register.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/register.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/register.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/register.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/register.rb