3 sets up an irc connection, and not much more.
8 - [x] tls (optional cert validation)
9 - [?] sasl plain (untested)
10 - [x] set user and nick
11 - [x] wait for motd/001-message
12 - [x] optionally, do an initial join
16 - respond to server pings
17 - keep track of when we last received an irc mesasge; if t > $timeout, send ping ourselves.
18 (first implementation can just send a ping every $timeout (milli)seconds)
19 (should $timeout be the time between last message and send-ping or between last message and ping-reponse?)
23 - time between sent message and received response
24 - send/recv block: invalid, due to polling
28 - read from stdin, write to stdout
29 - cli for setting timeout, user/nick, server info, ...
30 - netcat-like (everything but host[{: }port] optional
32 - how to specify auth?
33 - relatively secure password handling!
38 - we don't guard against escape sequences in responses. when used interactively,
39 a bad actor could send malicious sequences causing terminal corruption.
40 causing data leaks (by querying terminal information) is unlikely, as the
41 responses won't be proper irc PRIVMSGs.
46 - check if port is valid
47 - irc_poll: handle poll() EINTR (don't exit on nonfatal signal received)
54 ## dropped features (patches accepted)
55 - nickserv: freenode and hackint support sasl, efenet neither. rest don't care.
56 - sasl cert: don't care for it
57 - optionally use socket instead of stdin/stdout?
58 - checking responses to NICK, JOIN, CAP-REQ, AUTHENTICATE
59 for now, we're just assuming everything went ok.
61 ok: 001 (checked, to block further commands)
62 err: 432 433 436 437 <nick>
65 err: 471 473 474 475 403 405 437 <chan>
72 err: 902 904 905 908 <nick>
73 - maybe allow HOST:PORT (nc doesn't)
74 - maybe allow HOST +PORT and/or HOST:+PORT for tls
75 - maybe allow irc://HOST:PORT and ircs://HOST:PORT
76 - what to do when nick is taken
78 - use fallback nick (append '_')
79 - allow specifying alternate nicks
80 - exit (this is what we do now on receiving the numeric error response)
83 all of these would require modifying the streaming data, which is more trouble
84 than it's worth. these could be implemented as external filters, though.
85 - -C flag to translate CRLF to LF (from server) and LF to CRLF (from stdin)
86 - -A flag to strip ctrlchars (formatting, colors, etc) from stdout
87 - enforce max line length (512 bytes, including CRLF) by splitting PRIVMSG
91 we need to check and handle multiple responses to commands we've send:
92 - ping: pong (everytime, everywhere. keep current hack)
93 - sasl: cap-ack, 900+903 or 90x (when authenticating, during setup)
94 - (after connecting/authenticating): 001, nick-in-use (everytime, during setup)
96 the server may send unrelated responses in-between - including pings - and we
97 want to enforce a timeout in which we expect the response (2000ms).
100 essentially, we send a command, then block until we receive a response or an error.
101 commands we send that we need to wait for are: