.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AnyEvent::XMPP::Ext::MUC::Room 3pm" .TH AnyEvent::XMPP::Ext::MUC::Room 3pm "2022-12-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" AnyEvent::XMPP::Ext::MUC::Room \- Room class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module represents a room handle for a \s-1MUC.\s0 .SH "METHODS" .IX Header "METHODS" .IP "\fBnew (%args)\fR" 4 .IX Item "new (%args)" .PD 0 .IP "\fBget_user ($nick)\fR" 4 .IX Item "get_user ($nick)" .PD This method returns the user with the \f(CW$nick\fR in the room. .IP "\fBget_me\fR" 4 .IX Item "get_me" This method returns the AnyEvent::XMPP::Ext::MUC::User object of yourself in the room. If will return undef if we are not in the room anymore. .IP "\fBget_user_jid ($jid)\fR" 4 .IX Item "get_user_jid ($jid)" This method looks whether a user with the \s-1JID\s0 \f(CW$jid\fR exists in the room. That means whether the node and domain part of the \&\s-1JID\s0 match the rooms node and domain part, and the resource part of the \&\s-1JID\s0 matches a joined nick. .IP "\fBget_users\fR" 4 .IX Item "get_users" This method returns the list of occupants as AnyEvent::XMPP::Ext::MUC::User objects. .IP "\fBmake_instant ($cb)\fR" 4 .IX Item "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. .Sp If you want to create a reserved room instead don't forget to unset the \&\f(CW\*(C`create_instant\*(C'\fR argument of the \f(CW\*(C`join_room\*(C'\fR method of AnyEvent::XMPP::Ext::MUC! .Sp See also the \f(CW\*(C`request_configuration\*(C'\fR method below for the reserved room config. .Sp \&\f(CW$cb\fR is the callback that will be called when the instant room creation is finished. If successful the first argument will be this room object (\f(CW$self\fR), if unsuccessful the first argument will be undef and the second will be a AnyEvent::XMPP::Error::IQ object. .IP "\fBrequest_configuration ($cb)\fR" 4 .IX Item "request_configuration ($cb)" This method requests the room configuration. When the configuration form or an error arrives \f(CW$cb\fR will be called. The first argument to the callback will be a AnyEvent::XMPP::Ext::DataForm with the room configuration form or undef in case of an error. The second argument will be a AnyEvent::XMPP::Error::MUC error object if an error occurred or undef if no error occurred. .Sp If you made an answer form you can send it via the \f(CW\*(C`send_configuration\*(C'\fR method below. .Sp Here is an example: .Sp .Vb 3 \& $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 (\*(Aqmuc#roomconfig_maxusers\*(Aq, 20); \& $af\->clear_empty_fields; \& \& $roomhdl\->send_configuration ($af, sub { \& # ... \& }); \& }); .Ve .ie n .IP """send_configuration ($answer_form, $cb)""" 4 .el .IP "\f(CWsend_configuration ($answer_form, $cb)\fR" 4 .IX Item "send_configuration ($answer_form, $cb)" This method sends the answer form to a configuration request to the room. \&\f(CW$answer_form\fR should be a AnyEvent::XMPP::Ext::DataForm object containig the answer form with the changed configuration. .Sp The first argument of \f(CW$cb\fR will be a true value if the configuration change was successful. The second argument of \f(CW$cb\fR will be a \f(CW\*(C`AnyEvent::XMPP::Error::IQ\*(C'\fR object if the configuration change was not successful. .IP "\fBmake_message (%args)\fR" 4 .IX Item "make_message (%args)" This method constructs a AnyEvent::XMPP::Ext::MUC::Message with a connection to this room. .Sp \&\f(CW%args\fR are further arguments for the constructor of AnyEvent::XMPP::Ext::MUC::Message. The default \f(CW\*(C`to\*(C'\fR argument for the message is the room and the \&\f(CW\*(C`type\*(C'\fR will be 'groupchat'. .IP "\fBsend_part ($msg, \f(CB$cb\fB, \f(CB$timeout\fB)\fR" 4 .IX Item "send_part ($msg, $cb, $timeout)" This lets you part the room, \f(CW$msg\fR is an optional part message and can be undef if no custom message should be generated. .Sp \&\f(CW$cb\fR is called when we successfully left the room or after \&\f(CW$timeout\fR seconds. The default for \f(CW$timeout\fR is 60. .Sp The first argument to the call of \f(CW$cb\fR 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). .IP "\fBusers\fR" 4 .IX Item "users" Returns a list of AnyEvent::XMPP::Ext::MUC::User objects which are in this room. .IP "\fBjid\fR" 4 .IX Item "jid" Returns the bare \s-1JID\s0 of this room. .IP "\fBnick_jid\fR" 4 .IX Item "nick_jid" Returns the full \s-1JID\s0 of yourself in the room. .IP "\fBis_connected\fR" 4 .IX Item "is_connected" Returns true if this room is still connected (but maybe not joined (yet)). .IP "\fBconnection\fR" 4 .IX Item "connection" If the room is still joined this method will return the connection on which the room is connected. .IP "\fBis_joined\fR" 4 .IX Item "is_joined" Returns true if this room is still joined (and connected). .IP "\fBchange_nick ($newnick)\fR" 4 .IX Item "change_nick ($newnick)" This method lets you change your nickname in this room. .IP "\fBchange_subject ($newsubject)\fR" 4 .IX Item "change_subject ($newsubject)" This methods changes the subject of the room. .SH "AUTHOR" .IX Header "AUTHOR" Robin Redeker, \f(CW\*(C`\*(C'\fR, \s-1JID:\s0 \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007, 2008 Robin Redeker, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.