Net::Jabber::X::Roster - Jabber IQ Roster Module
Net::Jabber::X::Roster is a companion to the Net::Jabber::X module. It provides the user a simple interface to set and retrieve all parts of a Jabber IQ Roster x.
To initialize the IQ with a Jabber <iq/> and then access the roster x you must pass it the XML::Parser Tree array from the Net::Jabber::Client module. In the callback function for the iq: use Net::Jabber; sub foo { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:roster"); my $xTag; foreach $xTag (@xTags) { $xTag->.... } . . . } You now have access to all of the retrieval functions available. To create a new IQ roster to send to the server: use Net::Jabber; $client = new Net::Jabber::Client(); ... $foo = new Net::Jabber::Foo(); $roster = $foo->NewX("jabber:x:roster"); ... $client->Send($foo); Using $roster you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation.
@items = $roster->GetItems();
$item = $roster->AddItem();
GetItems() - returns an array of Net::Jabber::X::Roster::Item objects. These can be modified or accessed with the functions available to them.
AddItem(XML::Parser tree) - creates a new Net::Jabbber::X::Roster::Item object and populates it with the tree if one was passed in. This returns the pointer to the <item/> so you can modify it with the creation functions from that module.
By Ryan Eatmon in May of 2000 for http://jabber.org..
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Jabber, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Jabber
CPAN shell
perl -MCPAN -e shell install Net::Jabber
For more information on module installation, please visit the detailed CPAN module installation guide.