.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "AnyEvent::XMPP::Ext::MUC::Room 3pm" .TH AnyEvent::XMPP::Ext::MUC::Room 3pm "2012-01-23" "perl v5.14.2" "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'. .ie n .IP "\fBsend_part ($msg, \fB$cb\fB, \f(BI$timeout\fB)\fR" 4 .el .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.