![](http://www.gnu-darwin.org/hexley-gd-sm.png)
|
# File jabber4r/roster.rb, line 231
def add(jid, subscription, name, group=nil)
if jid.kind_of? String
jid = JID.new(jid)
jid.strip_resource
elsif jid.kind_of? JID
jid = JID.new(jid.node+"@"+jid.host)
else
return
end
begin
item = RosterItem.new(self, jid, subscription, name, group)
@map[jid.to_s] = item
notify_listeners(ITEM_ADDED, item)
rescue => ex
puts ex.backtrace.join("\n")
end
end
|