GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::XMPP2::IM::Roster(3) User Contributed Perl Documentation Net::XMPP2::IM::Roster(3)

Net::XMPP2::IM::Roster - Instant messaging roster for XMPP

   my $con = Net::XMPP2::IM::Connection->new (...);
   ...
   my $ro  = $con->roster;
   if (my $c = $ro->get_contact ('test@example.com')) {
      $c->make_message ()->add_body ("Hello there!")->send;
   }

This module represents a class for roster objects which contain contact information.

It manages the roster of a JID connected by an Net::XMPP2::IM::Connection. It manages also the presence information that is received.

You get the roster by calling the "roster" method on an Net::XMPP2::IM::Connection object. There is no other way.

is_retrieved
Returns true if this roster was fetched from the server or false if this roster hasn't been retrieved yet.
new_contact ($jid, $name, $groups, $cb)
This method sends a roster item creation request to the server. $jid is the JID of the contact. $name is the nickname of the contact, which can be undef. $groups should be a array reference containing the groups this contact should be in.

The callback in $cb will be called when the creation is finished. The first argument will be the "Net::XMPP2::IM::Contact" object if no error occured. The second argument will be an Net::XMPP2::Error::IQ object if the request resulted in an error.

Please note that the contact you are given in that callback might not yet be on the roster ("is_on_roster" still returns a false value), if the server did send the roster push after the iq result of the roster set, so don't rely on the fact that the contact is on the roster.

delete_contact ($jid, $cb)
This method will send a request to the server to delete this contact from the roster. It will result in cancelling all subscriptions.

$cb will be called when the request was finished. The first argument to the callback might be a Net::XMPP2::Error::IQ object if the request resulted in an error.

get_contact ($jid)
Returns the contact on the roster with the JID $jid. (If $jid is not bare the resource part will be stripped before searching)

The return value is an instance of Net::XMPP2::IM::Contact.

get_contacts
Returns the contacts that are on this roster as Net::XMPP2::IM::Contact objects.

NOTE: This method only returns the contacts that have a roster item. If you haven't retrieved the roster yet the presence information is still stored but you have to get the contacts without a roster item with the "get_contacts_off_roster" method. See below.

get_contacts_off_roster
Returns the contacts that are not on the roster but for which we have received presence. Return value is a list of Net::XMPP2::IM::Contact objects.

See also documentation of "get_contacts" method of Net::XMPP2::IM::Roster above.

debug_dump
This prints the roster and all it's contacts and their presences.

Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"

Net::XMPP2::IM::Connection, Net::XMPP2::IM::Contact, Net::XMPP2::IM::Presence

Copyright 2007 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.

2007-12-10 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.