1AnyEvent::XMPP::Ext::MUUCs:e:rRoCoomn(t3r)ibuted Perl DoAcnuymEevnetnatt:i:oXnMPP::Ext::MUC::Room(3)
2
3
4
6 AnyEvent::XMPP::Ext::MUC::Room - Room class
7
10 This module represents a room handle for a MUC.
11
13 new (%args)
14 get_user ($nick)
15 This method returns the user with the $nick in the room.
16
17 get_me
18 This method returns the AnyEvent::XMPP::Ext::MUC::User object of
19 yourself in the room. If will return undef if we are not in the
20 room anymore.
21
22 get_user_jid ($jid)
23 This method looks whether a user with the JID $jid exists in the
24 room. That means whether the node and domain part of the JID match
25 the rooms node and domain part, and the resource part of the JID
26 matches a joined nick.
27
28 get_users
29 This method returns the list of occupants as
30 AnyEvent::XMPP::Ext::MUC::User objects.
31
32 make_instant ($cb)
33 If you just created a room you can create an instant room with this
34 method instead of going through room configuration for a reserved
35 room.
36
37 If you want to create a reserved room instead don't forget to unset
38 the "create_instant" argument of the "join_room" method of
39 AnyEvent::XMPP::Ext::MUC!
40
41 See also the "request_configuration" method below for the reserved
42 room config.
43
44 $cb is the callback that will be called when the instant room
45 creation is finished. If successful the first argument will be
46 this room object ($self), if unsuccessful the first argument will
47 be undef and the second will be a AnyEvent::XMPP::Error::IQ object.
48
49 request_configuration ($cb)
50 This method requests the room configuration. When the configuration
51 form or an error arrives $cb will be called. The first argument to
52 the callback will be a AnyEvent::XMPP::Ext::DataForm with the room
53 configuration form or undef in case of an error. The second
54 argument will be a AnyEvent::XMPP::Error::MUC error object if an
55 error occurred or undef if no error occurred.
56
57 If you made an answer form you can send it via the
58 "send_configuration" method below.
59
60 Here is an example:
61
62 $room->request_configuration (sub {
63 my ($form, $err) = @_;
64 $form or return;
65
66 my $af = AnyEvent::XMPP::Ext::DataForm->new;
67 $af->make_answer_form ($form);
68 $af->set_field_value ('muc#roomconfig_maxusers', 20);
69 $af->clear_empty_fields;
70
71 $roomhdl->send_configuration ($af, sub {
72 # ...
73 });
74 });
75
76 "send_configuration ($answer_form, $cb)"
77 This method sends the answer form to a configuration request to the
78 room. $answer_form should be a AnyEvent::XMPP::Ext::DataForm
79 object containig the answer form with the changed configuration.
80
81 The first argument of $cb will be a true value if the configuration
82 change was successful. The second argument of $cb will be a
83 "AnyEvent::XMPP::Error::IQ" object if the configuration change was
84 not successful.
85
86 make_message (%args)
87 This method constructs a AnyEvent::XMPP::Ext::MUC::Message with a
88 connection to this room.
89
90 %args are further arguments for the constructor of
91 AnyEvent::XMPP::Ext::MUC::Message. The default "to" argument for
92 the message is the room and the "type" will be 'groupchat'.
93
94 send_part ($msg, $cb, $timeout)
95 This lets you part the room, $msg is an optional part message and
96 can be undef if no custom message should be generated.
97
98 $cb is called when we successfully left the room or after $timeout
99 seconds. The default for $timeout is 60.
100
101 The first argument to the call of $cb will be undef if we
102 successfully parted, or a true value when the timeout hit. Even if
103 we timeout we consider ourself parted (and a 'leave' event is
104 generated).
105
106 users
107 Returns a list of AnyEvent::XMPP::Ext::MUC::User objects which are
108 in this room.
109
110 jid Returns the bare JID of this room.
111
112 nick_jid
113 Returns the full JID of yourself in the room.
114
115 is_connected
116 Returns true if this room is still connected (but maybe not joined
117 (yet)).
118
119 connection
120 If the room is still joined this method will return the connection
121 on which the room is connected.
122
123 is_joined
124 Returns true if this room is still joined (and connected).
125
126 change_nick ($newnick)
127 This method lets you change your nickname in this room.
128
129 change_subject ($newsubject)
130 This methods changes the subject of the room.
131
133 Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
134
136 Copyright 2007, 2008 Robin Redeker, all rights reserved.
137
138 This program is free software; you can redistribute it and/or modify it
139 under the same terms as Perl itself.
140
141
142
143perl v5.28.1 2012-12-25 AnyEvent::XMPP::Ext::MUC::Room(3)