Software /
code /
clix
Comparison
clix.lua @ 88:2c2e241e68df
clix.lua: Log "connected as ..." instead of writing it directly to stderr
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 30 Jun 2012 00:59:47 +0200 |
parent | 87:a93406de9f0f |
child | 89:a8b63fbad807 |
comparison
equal
deleted
inserted
replaced
87:a93406de9f0f | 88:2c2e241e68df |
---|---|
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()); |