plugins/bind.lua

changeset 78
f4188eff53a7
parent 43
a33036b7e5ab
child 160
5cbbfe42212e
equal deleted inserted replaced
77:7af3e57501c2 78:f4188eff53a7
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("binding-success", full_jid); 17 stream:event("bind-success", full_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("binding-failure", { error = condition, text = text, type = type }); 21 stream:event("bind-failure", { error = condition, text = text, type = type });
22 end 22 end
23 end); 23 end);
24 end 24 end
25 stream:hook("stream-features", handle_features, 200); 25 stream:hook("stream-features", handle_features, 200);
26 return true; 26 return true;

mercurial