108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
# File 'lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/pep-aggregator/pep-aggregator.rb', line 108
def index
"<?xml version='1.0' encoding='UTF-8'?>" +
"<items xmlns:jabber='jabber:client' jabber:to='#{Jabber::JID.new(JID).strip}'>" +
$jid_items.collect do |jid,item_orig|
item = item_orig.deep_clone
item.attributes['jabber:from'] = jid.to_s
vcard = $vcards.get_until(jid)
if vcard.kind_of? Jabber::Vcard::IqVcard
item.attributes['jabber:from-name'] = vcard['NICKNAME'] || vcard['FN'] || jid.node
item.attributes['jabber:has-avatar'] = (vcard['PHOTO/TYPE'] and
vcard['PHOTO/BINVAL']) ? 'true' : 'false'
else
item.attributes['jabber:from-name'] = jid.node
item.attributes['jabber:has-avatar'] = 'false'
end
item
end.join +
"</items>"
end
|