AnyEven...C::Room(3)
π AnyEvent::XMPP::Ext::MUC::Room(3)
okay so bestie, gather round π«Ά this is the Perl manual page for AnyEvent::XMPP::Ext::MUC::Room β a room handle class, brought to you by the User Contributed Perl Documentation girlies β¨
πΈ NAME πΈ
AnyEvent::XMPP::Ext::MUC::Room β it's literally the Room class, no cap π
π SYNOPSIS π
so likeβ¦ there's genuinely nothing here π the synopsis section is empty in the original, so we're not making anything up. moving on bestie π¦
β¨ DESCRIPTION β¨
This module represents a room handle for a MUC β that's it, that's the vibe. It's the little object that holds your whole room situation together π
π METHODS π
new (%args)
the constructor, iconic, does what it says on the tin β takes %args π
get_user ($nick)
This method returns the user with the $nick in the room. just hand over a nick, get the user back π«Ά
get_me
This method returns the AnyEvent::XMPP::Ext::MUC::User object of yourself in the room β main character identification, literally π
it will return undef if we are not in the room anymore π (yes, the original says "If will return undef", we're keeping the facts, not the typo energy, but the meaning is: gone from the room = undef)
get_user_jid ($jid)
This method looks whether a user with the JID $jid exists in the room π
That means whether the node and domain part of the JID match the room's node and domain part, and the resource part of the JID matches a joined nick. so: node + domain gotta line up with the room, and the resource gotta line up with a nick somebody actually joined under β¨
get_users
This method returns the list of occupants as AnyEvent::XMPP::Ext::MUC::User objects. everyone in the room, gathered, slay πΈ
make_instant ($cb)
If you just created a room you can create an instant room with this method instead of going through room configuration for a reserved room. speedrun energy β‘
π¨ If you want to create a reserved room instead, don't forget to unset the"create_instant"argument of the"join_room"method ofAnyEvent::XMPP::Ext::MUC! that's the whole plot twist bestie π€
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 π«Ά
request_configuration ($cb)
This method requests the room configuration π When the configuration form or an error arrives $cb will be called.
- The first argument to the callback will be a
AnyEvent::XMPP::Ext::DataFormwith the room configuration form, orundefin case of an error π - The second argument will be a
AnyEvent::XMPP::Error::MUCerror object if an error occurred, orundefif no error occurred β¨
If you made an answer form you can send it via the "send_configuration" method below π
Here is an example β look at it, it's giving competence:
$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 {
# ...
});
});
"send_configuration ($answer_form, $cb)"
This method sends the answer form to a configuration request to the room π¨ $answer_form should be a AnyEvent::XMPP::Ext::DataForm object containing the answer form with the changed configuration.
- The first argument of
$cbwill be a true value if the configuration change was successful β - The second argument of
$cbwill be a"AnyEvent::XMPP::Error::IQ"object if the configuration change was not successful π
make_message (%args)
This method constructs a AnyEvent::XMPP::Ext::MUC::Message with a connection to this room π
%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' β presets, we love to see it π
send_part ($msg, $cb, $timeout)
This lets you part the room π $msg is an optional part message and can be undef if no custom message should be generated.
$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
$cbwill beundefif 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) β so like, timeout still counts as out the door, periodt π
users
Returns a list of AnyEvent::XMPP::Ext::MUC::User objects which are in this room π
jid
Returns the bare JID of this room π¦
nick_jid
Returns the full JID of yourself in the room π
is_connected
Returns true if this room is still connected (but maybe not joined (yet)) π
connection
If the room is still joined this method will return the connection on which the room is connected π‘
is_joined
Returns true if this room is still joined (and connected) π«Ά
change_nick ($newnick)
This method lets you change your nickname in this room β rebrand era β¨
change_subject ($newsubject)
This method changes the subject of the room π (the original says "methods", we said method, the behaviour is the same bestie, don't come for me)
π AUTHOR π
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>" β the icon who wrote this π«Ά
π COPYRIGHT & LICENSE π
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.
π and that's the whole page bestie, no notes. this was perl v5.42.2, dated 2026-02-15 β mwah, go build something cute π πβ¨
π¦ where this page comes from
- alpine 3.24: perl-anyevent-xmpp-doc 0.55-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms