I'm currently investigating the IRC Protocol as implemented by twisted, to see if I perhaps can use it in my irc client, or if it perhaps can use code from my irc protocol parsing.
However, I noticed some bugs and (imho) design failures in the current implementation, which makes the code not very usefull for any other use than what it's currently used for (twisted irc client + server?)
For example, channels are hardcoded as starting with '#', i.e. IRCClient.join prepends a '#' to the channelname. Hoewever, most servers support alernative style channels such as &channel (local channels), +channel (modeless channels), and perhaps more.
Furthermore, IMHO, the IRCClient class implements too many protocols in one class. IRC, CTCP and DCC are distinct protocols, and each belong in their own class.
Lastly, the current parsemsg routine can't handle ipv6 addresses in certain replies, i.e. a 311 (whois) reply like:
:irc.xs4all.nl 311 VladDrac [p] -patrick 3ffe:2500:900:2000:1337:1337:1337:1337 *:foo
will be parsed incorrectly. I may provide a patch for this later.
Is replacing the current IRC protocol with a (non-api-compatible) new protocol discussable? If so, I'll make some suggestions on how I would implement the protocol.