Class: JabberAdmin::Commands::BanAccount

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

Overview

Ban an account by kicking sessions and set random password.

Class Method Summary collapse

Class Method Details

.call(callable, user:, reason:) ⇒ 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)

  • reason (String)

    the banning reason (eg. Spamming other users)



14
15
16
17
# File 'lib/jabber_admin/commands/ban_account.rb', line 14

def self.call(callable, user:, reason:)
  uid, host = user.split('@')
  callable.call('ban_account', user: uid, host: host, reason: reason)
end