5 |
5 |
6 function verse.plugins.bind(stream) |
6 function verse.plugins.bind(stream) |
7 local function handle_features(features) |
7 local function handle_features(features) |
8 if stream.bound then return; end |
8 if stream.bound then return; end |
9 stream:debug("Binding resource..."); |
9 stream:debug("Binding resource..."); |
10 stream:send_iq(verse.iq({ type = "set" }):tag("bind", {xmlns=xmlns_bind}):tag("resource"):text(stream.resource), |
10 stream:send_iq(verse.iq({ id="bind",type = "set" }):tag("bind", {xmlns=xmlns_bind}):tag("resource"):text(stream.resource), |
11 function (reply) |
11 function (reply) |
12 if reply.attr.type == "result" then |
12 if reply.attr.type == "result" then |
13 local result_jid = reply |
13 local result_jid = reply |
14 :get_child("bind", xmlns_bind) |
14 :get_child("bind", xmlns_bind) |
15 :get_child_text("jid"); |
15 :get_child_text("jid"); |