Class Jabber::Roster
In: lib/jabber4r/roster.rb
Parent: Object

The Roster class encapsulates the runtime roster of the session instance. The Roster contains all subscriptions in a Jabber::Roster::RosterItem hash.

Methods

Classes and Modules

Class Jabber::Roster::RosterItem

Constants

ITEM_ADDED = 1
ITEM_DELETED = 2
RESOURCE_ADDED = 4
RESOURCE_UPDATED = 8
RESOURCE_DELETED = 16

Attributes

session  [R]  The Jabber::Session instance

Public Class methods

Creates a Roster for the session

session:[Jabber::Session] The session instance

Public Instance methods

Returns a Jabber::Roster::RosterItem based on the JID

jid:[Jabber::JID | String] The Jabber ID
return:[Jabber::Roster::RosterItem] The roster item

Adds a subscription to be tracked in the Roster

jid:[JID | String] The Jabber ID
subscription:[String] The subscription type (both)
name:[String] The nickname
group:[String = nil] The name of the group of the roster item.

Adds a listener to the roster to process roster changes

&block:[Block |event, rosteritem|] The block to process roster changes
return:[String] The listener id to use to deregister

Deletes a roster item based on the supplied Jabber ID

jid:[Jabber::JID | String]

Deletes a listener for processing roster messages

id:[String] A listener id (given by add_listener)

Iterates over each RosterItem

yield:[Jabber::Roster::RosterItem] The roster item.

Notifies listeners of a roster change event

event:[Integer] The roster event
object:[RosterItem] The modified item

Dumps the Roster state as a string

return:[String] The roster state

[Validate]