1AnyEvent::XMPP::IM::ConUnseecrtiCoonn(t3r)ibuted Perl DoAcnuymEevnetnatt:i:oXnMPP::IM::Connection(3)
2
3
4

NAME

6       AnyEvent::XMPP::IM::Connection - "XML" stream that implements the XMPP
7       RFC 3921.
8

SYNOPSIS

10          use AnyEvent::XMPP::Connection;
11
12          my $con = AnyEvent::XMPP::Connection->new;
13

DESCRIPTION

15       This module represents a XMPP instant messaging connection and
16       implements RFC 3921.
17
18       This module is a subclass of "AnyEvent::XMPP::Connection" and inherits
19       all methods.  For example "reg_cb" and the stanza sending routines.
20
21       For additional events that can be registered to look below in the
22       EVENTS section.
23

METHODS

25       new (%args)
26           This is the constructor. It takes the same arguments as the
27           constructor of AnyEvent::XMPP::Connection along with a few others:
28
29           dont_retrieve_roster => $bool
30               Set this to a true value if no roster should be requested on
31               connection establishment. You can retrieve the roster later if
32               you want to with the "retrieve_roster" method.
33
34               The internal roster will be set even if this option is active,
35               and even presences will be stored in there, except that the
36               "get_contacts" method on the roster object won't return
37               anything as there are no roster items.
38
39           initial_presence => $priority
40               This sets whether the initial presence should be sent.
41               $priority should be the priority of the initial presence. The
42               default value for the initial presence $priority is 10.
43
44               If you pass a undefined value as $priority no initial presence
45               will be sent!
46
47       retrieve_roster ($cb)
48           This method initiates a roster request. If you set
49           "dont_retrieve_roster" when creating this connection no roster was
50           retrieved.  You can do that with this method. The coderef in $cb
51           will be called after the roster was retrieved.
52
53           The first argument of the callback in $cb will be the roster and
54           the second will be a AnyEvent::XMPP::Error::IQ object when an error
55           occurred while retrieving the roster.
56
57       get_roster
58           Returns the roster object of type AnyEvent::XMPP::IM::Roster.
59

EVENTS

61       These additional events can be registered on with "reg_cb":
62
63       In the following events $roster is the AnyEvent::XMPP::IM::Roster
64       object you get by calling "get_roster".
65
66       NODE: The first argument to each callback is always the
67       AnyEvent::XMPP::IM::Connection object itself. Also see Object::Event
68       for more information about registering callbacks.
69
70       session_ready
71           This event is generated when the session has been fully established
72           and can be used to send around messages and other stuff.
73
74       session_error => $error
75           If an error happened during establishment of the session this event
76           will be generated. $error will be an AnyEvent::XMPP::Error::IQ
77           error object.
78
79       roster_update => $roster, $contacts
80           This event is emitted when a roster update has been received.
81           $contacts is an array reference of AnyEvent::XMPP::IM::Contact
82           objects which have changed. If a contact was removed it will return
83           'remove' when you call the "subscription" method on it.
84
85           The first time this event is sent is when the roster was received
86           for the first time.
87
88       roster_error => $error
89           If an error happened during retrieval of the roster this event will
90           be generated.  $error will be an AnyEvent::XMPP::Error::IQ error
91           object.
92
93       presence_update => $roster, $contact, $old_presence, $new_presence
94           This event is emitted when the presence of a contact has changed.
95           $contact is the AnyEvent::XMPP::IM::Contact object which presence
96           status has changed.  $old_presence is a
97           AnyEvent::XMPP::IM::Presence object which represents the presence
98           prior to the change.  $new_presence is a
99           AnyEvent::XMPP::IM::Presence object which represents the presence
100           after to the change. The new presence might be undef if the new
101           presence is 'unavailable'.
102
103       presence_error => $error
104           This event is emitted when a presence stanza error was received.
105           $error will be an AnyEvent::XMPP::Error::Presence error object.
106
107       message => $msg
108           This event is emitted when a message was received.  $msg is a
109           AnyEvent::XMPP::IM::Message object.
110
111       message_error => $error
112           This event is emitted when a message stanza error was received.
113           $error will be an AnyEvent::XMPP::Error::Message error object.
114
115       contact_request_subscribe => $roster, $contact, $message
116           This event is generated when the $contact wants to subscribe to
117           your presence.
118
119           If you want to accept or decline the request, call
120           "send_subscribed" method of AnyEvent::XMPP::IM::Contact or
121           "send_unsubscribed" method of AnyEvent::XMPP::IM::Contact on
122           $contact.
123
124           If you want to start a mutual subscription you have to call
125           "send_subscribe" AFTER you accepted or declined with
126           "send_subscribed"/"send_unsubscribed".  Calling it in the opposite
127           order gets some servers confused!
128
129           If a "status" element was transmitted with the subscription it's
130           contents will be in $message. Which is usually a text written from
131           the one who requests subscription.
132
133       contact_subscribed => $roster, $contact, $message
134           This event is generated when $contact subscribed you to his
135           presence successfully.
136
137           If a "status" element was transmitted with the subscribed presence
138           it's contents will be in $message.
139
140       contact_did_unsubscribe => $roster, $contact, $message
141           This event is generated when $contact unsubscribes from your
142           presence.
143
144           If you want to unsubscribe from him call the "send_unsubscribe"
145           method of AnyEvent::XMPP::IM::Contact on $contact.
146
147           If a "status" element was transmitted with the unsubscription it's
148           contents will be in $message. Which is usually a text written from
149           the one who unsubscribes.
150
151       contact_unsubscribed => $roster, $contact, $message
152           This event is generated when $contact unsubscribed you from his
153           presence.
154
155           If you want to unsubscribe him from your presence call the
156           "send_unsubscribed" method of AnyEvent::XMPP::IM::Contact on
157           $contact.
158
159           If a "status" element was transmitted with the unsubscription it's
160           contents will be in $message.
161

AUTHOR

163       Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
164
166       Copyright 2007, 2008 Robin Redeker, all rights reserved.
167
168       This program is free software; you can redistribute it and/or modify it
169       under the same terms as Perl itself.
170
171
172
173perl v5.32.0                      2020-07-28 AnyEvent::XMPP::IM::Connection(3)
Impressum