Class for handling roster updates
You must do 'client.send(Iq.new_rosterget)' or else you will have nothing to put in #receive_iq()
You must require 'xmpp4r/rosterquery' to use this class as its functionality is not needed for a working XMPP implementation. This will make [IqQuery] convert all Queries with namespace 'jabber:iq:roster' to [IqQueryRoster]
This <query/> contains multiple <item/> children. See RosterItem.
Iterate through all items
Yield for every [RosterItem]
# File lib/xmpp4r/roster/iq/roster.rb, line 27 def each(&block) each_element { |item| # XPath won't work here as it's missing a prefix... yield(item) if item.kind_of?(RosterItem) } end
Output for āpā
JIDs of all contained [RosterItem] elements are joined with a comma
# File lib/xmpp4r/roster/iq/roster.rb, line 74 def inspect jids = to_a.collect { |item| item.jid.inspect } jids.join(', ') end
Update roster by <iq/> stanza (to be fed by an iq_callback)
Containing new roster
If false import non-roster-like results too
# File lib/xmpp4r/roster/iq/roster.rb, line 61 def receive_iq(iq, filter=true) if filter && (((iq.type != :set) && (iq.type != :result)) || (iq.queryns != 'jabber:iq:roster')) return end import(iq.query) end
Get all items
of [RosterItem]
# File lib/xmpp4r/roster/iq/roster.rb, line 48 def to_a a = [] each { |item| a.push(item) } a end