AnyEvent::XMPP::IM::Connection(3pm) | User Contributed Perl Documentation | AnyEvent::XMPP::IM::Connection(3pm) |
AnyEvent::XMPP::IM::Connection - "XML" stream that implements the XMPP RFC 3921.
use AnyEvent::XMPP::Connection; my $con = AnyEvent::XMPP::Connection->new;
This module represents a XMPP instant messaging connection and implements RFC 3921.
This module is a subclass of "AnyEvent::XMPP::Connection" and inherits all methods. For example "reg_cb" and the stanza sending routines.
For additional events that can be registered to look below in the EVENTS section.
The internal roster will be set even if this option is active, and even presences will be stored in there, except that the "get_contacts" method on the roster object won't return anything as there are no roster items.
If you pass a undefined value as $priority no initial presence will be sent!
The first argument of the callback in $cb will be the roster and the second will be a AnyEvent::XMPP::Error::IQ object when an error occurred while retrieving the roster.
These additional events can be registered on with "reg_cb":
In the following events $roster is the AnyEvent::XMPP::IM::Roster object you get by calling "get_roster".
NODE: The first argument to each callback is always the AnyEvent::XMPP::IM::Connection object itself. Also see Object::Event for more information about registering callbacks.
The first time this event is sent is when the roster was received for the first time.
If you want to accept or decline the request, call "send_subscribed" method of AnyEvent::XMPP::IM::Contact or "send_unsubscribed" method of AnyEvent::XMPP::IM::Contact on $contact.
If you want to start a mutual subscription you have to call "send_subscribe" AFTER you accepted or declined with "send_subscribed"/"send_unsubscribed". Calling it in the opposite order gets some servers confused!
If a "status" element was transmitted with the subscription it's contents will be in $message. Which is usually a text written from the one who requests subscription.
If a "status" element was transmitted with the subscribed presence it's contents will be in $message.
If you want to unsubscribe from him call the "send_unsubscribe" method of AnyEvent::XMPP::IM::Contact on $contact.
If a "status" element was transmitted with the unsubscription it's contents will be in $message. Which is usually a text written from the one who unsubscribes.
If you want to unsubscribe him from your presence call the "send_unsubscribed" method of AnyEvent::XMPP::IM::Contact on $contact.
If a "status" element was transmitted with the unsubscription it's contents will be in $message.
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
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.
2022-12-06 | perl v5.36.0 |