31 |
31 |
32 local contacts = {}; |
32 local contacts = {}; |
33 |
33 |
34 conn:hook("ready", function () |
34 conn:hook("ready", function () |
35 conn:hook("presence", function (presence) |
35 conn:hook("presence", function (presence) |
36 if contacts[presence.attr.from] then return; end; |
36 if contacts[presence.attr.from] or presence.attr.type then return; end; |
37 |
37 |
38 local contact = { jid = presence.attr.from }; |
38 local contact = { jid = presence.attr.from }; |
39 contacts[contact.jid] = contact; |
39 contacts[contact.jid] = contact; |
40 |
40 |
41 local caps_tag = presence:get_child("c", xmlns_caps); |
41 local caps_tag = presence:get_child("c", xmlns_caps); |