plugins/bind.lua

changeset 43
a33036b7e5ab
parent 40
afd037420977
child 78
f4188eff53a7
equal deleted inserted replaced
42:6006e6bb1c28 43:a33036b7e5ab
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("binding-success", full_jid);
18 elseif reply.attr.type == "error" then 18 elseif reply.attr.type == "error" then
19 local err = result:child_with_name("error"); 19 local err = reply:child_with_name("error");
20 local type, condition, text = result:get_error(); 20 local type, condition, text = reply:get_error();
21 stream:event("binding-failure", { error = condition, text = text, type = type }); 21 stream:event("binding-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);

mercurial