Class: JabberAdmin::Commands::SetRoomAffiliation

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

Overview

Change a user affiliation in a MUC room. (eg. allow him to enter a members-only room)

Class Method Summary collapse

Class Method Details

.call(callable, user:, room:, affiliation: 'member') ⇒ 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)

  • room (String)

    room JID (eg. [email protected])

  • affiliation (String) (defaults to: 'member')

    the MUC/user affiliation (eg. member)



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

def self.call(callable, user:, room:, affiliation: 'member')
  name, service = room.split('@')
  callable.call('set_room_affiliation',
                name: name,
                service: service,
                jid: user,
                affiliation: affiliation)
end