new(%args)
Creates a new disco handle.
set_identity($category,$type,$name)
This sets the identity of the top info node.
$name is optional and can be undef. Please note that $name will overwrite all previous set names! If
$name is undefined then no previous set name is overwritten.
For a list of valid identites look at:
http://www.xmpp.org/registrar/disco-categories.html
Valid identity $types for "$category = "client"" may be:
bot
console
handheld
pc
phone
web
unset_identity($category,$type)
This function removes the identity $category and $type.
enable_feature($uri)
This method enables the feature $uri, where $uri should be one of the values from the Name column on:
http://www.xmpp.org/registrar/disco-features.html
These features are enabled by default:
http://jabber.org/protocol/disco#info
http://jabber.org/protocol/disco#items
You can pass also a list of features you want to enable to "enable_feature"!
disable_feature($uri)
This method enables the feature $uri, where $uri should be one of the values from the Name column on:
http://www.xmpp.org/registrar/disco-features.html
You can pass also a list of features you want to disable to "disable_feature"!
request_items($con,$dest,$node,$cb)
This method does send a items request to the JID entity $from. $node is the optional node to send
the request to, which can be undef.
$con must be an instance of AnyEvent::XMPP::Connection or a subclass of it. The callback $cb will be
called when the request returns with 3 arguments: the disco handle, an
AnyEvent::XMPP::Ext::Disco::Items object (or undef) and an AnyEvent::XMPP::Error::IQ object when an
error occured and no items were received.
The timeout of the request is the IQ timeout of the connection $con.
$disco->request_items ($con, 'a@b.com', undef, sub {
my ($disco, $items, $error) = @_;
die $error->string if $error;
# do something with the items here ;_)
});
request_info($con,$dest,$node,$cb)
This method does send a info request to the JID entity $from. $node is the optional node to send the
request to, which can be undef.
$con must be an instance of AnyEvent::XMPP::Connection or a subclass of it. The callback $cb will be
called when the request returns with 3 arguments: the disco handle, an
AnyEvent::XMPP::Ext::Disco::Info object (or undef) and an AnyEvent::XMPP::Error::IQ object when an
error occured and no items were received.
The timeout of the request is the IQ timeout of the connection $con.
$disco->request_info ($con, 'a@b.com', undef, sub {
my ($disco, $info, $error) = @_;
die $error->string if $error;
# do something with info here ;_)
});