plugins/bind.lua

changeset 160
5cbbfe42212e
parent 78
f4188eff53a7
child 197
7e98cf2c1d8d
equal deleted inserted replaced
159:88cc513e81c8 160:5cbbfe42212e
12 :get_child("bind", xmlns_bind) 12 :get_child("bind", xmlns_bind)
13 :get_child("jid") 13 :get_child("jid")
14 :get_text(); 14 :get_text();
15 stream.username, stream.host, stream.resource = jid.split(result_jid); 15 stream.username, stream.host, stream.resource = jid.split(result_jid);
16 stream.jid, stream.bound = result_jid, true; 16 stream.jid, stream.bound = result_jid, true;
17 stream:event("bind-success", full_jid); 17 stream:event("bind-success", { jid = result_jid });
18 elseif reply.attr.type == "error" then 18 elseif reply.attr.type == "error" then
19 local err = reply:child_with_name("error"); 19 local err = reply:child_with_name("error");
20 local type, condition, text = reply:get_error(); 20 local type, condition, text = reply:get_error();
21 stream:event("bind-failure", { error = condition, text = text, type = type }); 21 stream:event("bind-failure", { error = condition, text = text, type = type });
22 end 22 end

mercurial