clix.lua

changeset 106
730fcde562ce
parent 105
82c21f1d6f46
child 107
a074eaacefe7
equal deleted inserted replaced
105:82c21f1d6f46 106:730fcde562ce
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", "warn", "error"}); 61 verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "warn", "error"});
62 local conn = verse.new(verse.new_logger("clix")); 62 local conn = verse.new(verse.new_logger("clix"));
63 if opts.raw then
64 conn:hook("incoming-raw", print, 1000);
65 conn:hook("outgoing-raw", print, 1000);
66 end
63 for _, plugin in ipairs(plugins or {}) do 67 for _, plugin in ipairs(plugins or {}) do
64 conn:add_plugin(plugin); 68 conn:add_plugin(plugin);
65 end 69 end
66 conn:hook("authentication-failure", function (err) 70 conn:hook("authentication-failure", function (err)
67 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); 71 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or ""));

mercurial