Class: JabberAdmin::Commands::Register

Inherits:
Object
  • Object
show all
Defined in:
lib/jabber_admin/commands/register.rb

Overview

Register a new user on the XMPP service.

Class Method Summary collapse

Class Method Details

.call(callable, user:, password:) ⇒ Object

Pass the correct data to the given callable.

Parameters:

  • callable (Proc, #call)

    the callable to call

  • user (String)

    user JID wo/ resource (eg. tom@localhost)

  • password (String)

    the new plain password for the user (eg. secret)



15
16
17
18
19
20
21
22
# File 'lib/jabber_admin/commands/register.rb', line 15

def self.call(callable, user:, password:)
  uid, host = user.split('@')
  callable.call('register',
                check_res_body: false,
                user: uid,
                host: host,
                password: password)
end