soju seems to save the nickname in the DB on
/nick, even if the server replies with an error.
This results in failures to connect the next time soju needs to.
When receiving a
NICK from downstream, soju should wait for upstream to ack the nick before saving it in the database.
So far, all of the database content only depends on what the user chose. If the user joins a channel, the channel is immediately saved to the DB, even if a key is required. This prevents some surprises that could be caused by transient upstream errors and helps keep things simple (the upstream doesn't decide what should be in the DB).