| AnyEvent::XMPP::Ext::MUC::Room(3pm) | User Contributed Perl Documentation | AnyEvent::XMPP::Ext::MUC::Room(3pm) |
AnyEvent::XMPP::Ext::MUC::Room - Room class
This module represents a room handle for a MUC.
If you want to create a reserved room instead don't forget to unset the "create_instant" argument of the "join_room" method of AnyEvent::XMPP::Ext::MUC!
See also the "request_configuration" method below for the reserved room config.
$cb is the callback that will be called when the instant room creation is finished. If successful the first argument will be this room object ($self), if unsuccessful the first argument will be undef and the second will be a AnyEvent::XMPP::Error::IQ object.
If you made an answer form you can send it via the "send_configuration" method below.
Here is an example:
$room->request_configuration (sub {
my ($form, $err) = @_;
$form or return;
my $af = AnyEvent::XMPP::Ext::DataForm->new;
$af->make_answer_form ($form);
$af->set_field_value ('muc#roomconfig_maxusers', 20);
$af->clear_empty_fields;
$roomhdl->send_configuration ($af, sub {
# ...
});
});
The first argument of $cb will be a true value if the configuration change was successful. The second argument of $cb will be a "AnyEvent::XMPP::Error::IQ" object if the configuration change was not successful.
%args are further arguments for the constructor of AnyEvent::XMPP::Ext::MUC::Message. The default "to" argument for the message is the room and the "type" will be 'groupchat'.
$cb is called when we successfully left the room or after $timeout seconds. The default for $timeout is 60.
The first argument to the call of $cb will be undef if we successfully parted, or a true value when the timeout hit. Even if we timeout we consider ourself parted (and a 'leave' event is generated).
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
Copyright 2007, 2008 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2022-12-06 | perl v5.36.0 |