In: 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.


[], add, add_listener, delete, delete_listener, each_item, new, notify_listeners, to_s,

 [R]  :session

The Jabber::Session instance

Classes and Modules

Class Jabber::Roster::RosterItem
  ::Class Jabber::Roster::RosterItem::Resource

Public Class methods
new(session) src

Creates a Roster for the session

session:[Jabber::Session] The session instance
Public Instance methods
add_listener(&block) src

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
delete_listener(id) src

Deletes a listener for processing roster messages

id:[String] A listener id (given by add_listener)
add(jid, subscription, name, group=nil) src

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.
[](jid) src

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

jid:[Jabber::JID | String] The Jabber ID
return:[Jabber::Roster::RosterItem] The roster item
delete(jid) src

Deletes a roster item based on the supplied Jabber ID

jid:[Jabber::JID | String]
each_item() {|item}| ...} src

Iterates over each RosterItem

yield:[Jabber::Roster::RosterItem] The roster item.
to_s() src

Dumps the Roster state as a string

return:[String] The roster state
notify_listeners(event, object) src

Notifies listeners of a roster change event

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