NAME

Net::Jabber::Query::Roster - Jabber IQ Roster Module

SYNOPSIS

Net::Jabber::Query::Roster is a companion to the Net::Jabber::Query module.
It provides the user a simple interface to set and retrieve all parts 
of a Jabber IQ Roster query.

DESCRIPTION

To initialize the IQ with a Jabber <iq/> and then access the roster
query 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 iq {
    my $iq = new Net::Jabber::IQ(@_);
    my $roster = $iq->GetQuery();
    .
    .
    .
  }

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();
  ...

  $iq = new Net::Jabber::IQ();
  $roster = $iq->NewQuery("jabber:iq:roster");
  ...

  $client->Send($iq);

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.

Retrieval functions

@items     = $roster->GetItems();
@itemTrees = $roster->GetItemTrees();

Creation functions

$item   = $roster->AddItem();
$item   = $roster->AddItem(jid=>"bob\@jabber.org",
                           name=>"Bob",
                           groups=>["school","friends"]);

METHODS

Retrieval functions

GetItems() - returns an array of Net::Jabber::Query::Roster::Item objects.
             These can be modified or accessed with the functions
             available to them.

GetItemTrees() - returns an array of XML::Parser objects that contain
                 the data for each item.

Creation functions

AddItem(hash) - creates and returns a new Net::Jabbber::Query::Roster::Item
                object.  The argument hash is passed to the SetItem 
                function.  Check the Net::Jabber::Query::Roster::Item
                for valid values.

AUTHOR

By Ryan Eatmon in May of 2000 for http://jabber.org..

COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.