55 local account = accounts[opts.account or "default"]; |
55 local account = accounts[opts.account or "default"]; |
56 if not (account and account.jid) then |
56 if not (account and account.jid) then |
57 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); |
57 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); |
58 return nil; |
58 return nil; |
59 end |
59 end |
60 verse.set_logger(function () end); |
60 verse.set_logger(opts.verbose and print or function () end); |
61 local conn = verse.new(verse.logger()); |
61 local conn = verse.new(verse.logger()); |
62 conn.log.debug = opts.verbose; |
62 conn.log.debug = opts.verbose; |
63 conn:hook("authentication-failure", function (err) |
63 conn:hook("authentication-failure", function (err) |
64 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); |
64 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); |
65 end); |
65 end); |