63 items = roster.items, |
63 items = roster.items, |
64 }; |
64 }; |
65 end |
65 end |
66 |
66 |
67 -- should this be add_contact(item, callback) instead? |
67 -- should this be add_contact(item, callback) instead? |
68 function roster:add_contact(jid, nick, groups, callback) |
68 function roster:add_contact(jid, name, groups, callback) |
69 local item = { jid = jid, name = nick, groups = groups }; |
69 local item = { jid = jid, name = name, groups = groups }; |
70 local stanza = verse.iq({ type = "set" }) |
70 local stanza = verse.iq({ type = "set" }) |
71 :tag("query", { xmlns = xmlns_roster }) |
71 :tag("query", { xmlns = xmlns_roster }) |
72 :add_child(item_lua2xml(item)); |
72 :add_child(item_lua2xml(item)); |
73 stream:send_iq(stanza, function (reply) |
73 stream:send_iq(stanza, function (reply) |
74 if not callback then return end |
74 if not callback then return end |