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 "")); |
68 conn:close(); |
68 conn:close(); |
69 end); |
69 end); |
70 conn:hook("ready", function () |
70 conn:hook("ready", function () |
71 if not opts.quiet then |
71 conn:info("Connected as %s", conn.jid); |
72 io.stderr:write("clix: connected as ", conn.jid, "\n"); |
|
73 end |
|
74 if opts.chatroom then |
72 if opts.chatroom then |
75 conn:send(verse.presence{to=opts.to.."/"..(opts.nick or "clix")}); |
73 conn:send(verse.presence{to=opts.to.."/"..(opts.nick or "clix")}); |
76 end |
74 end |
77 if opts.presence then |
75 if opts.presence then |
78 conn:send(verse.presence()); |
76 conn:send(verse.presence()); |