clix.lua

changeset 89
a8b63fbad807
parent 88
2c2e241e68df
child 102
f1166645a56c
child 105
82c21f1d6f46
equal deleted inserted replaced
88:2c2e241e68df 89:a8b63fbad807
57 if not (account and account.jid) then 57 if not (account and account.jid) then
58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); 58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n");
59 return nil; 59 return nil;
60 end 60 end
61 verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "error"}); 61 verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "error"});
62 local conn = verse.new(); 62 local conn = verse.new(verse.new_logger("clix"));
63 for _, plugin in ipairs(plugins or {}) do 63 for _, plugin in ipairs(plugins or {}) do
64 conn:add_plugin(plugin); 64 conn:add_plugin(plugin);
65 end 65 end
66 conn:hook("authentication-failure", function (err) 66 conn:hook("authentication-failure", function (err)
67 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); 67 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or ""));

mercurial