Closed Bevinsky closed 5 years ago
Yep, I'm aware. I've had plans to change this for some time now, just haven't had the chance. See:
https://github.com/lrstanley/girc/pull/15#issuecomment-413845482
Had some time last night and figured I'd try and knock this out. Almost complete, should be able to finish later today.
Take a look at https://github.com/lrstanley/girc/pull/36 -- I'm sure there are likely to be bugs lurking with weird off-by-one issues, due to how things had to be handled the old way. LMK.
The IRC RFC says this about the format of commands:
and
In essence, there is no semantic difference between an argument parsed as a 'middle' or one as a 'trailing'. Trailing is simply a syntactic specification to allow the last argument in a command to contain spaces, if so desired.
However, girc doesn't follow this footnote and explicitly encodes 'trailing' as some special kind of command parameter. This is incorrect; if a command has a 'trailing' parameter, this is simply the last parameter of the command. There is no special meaning to it.
This makes the library cumbersome to use at best (since special care must be taken in regards to 'empty trailing', which should not be necessary at all), and broken at worst (since IRCds are within their rights to send commands for which you would 'expect' a trailing argument without one, such as PRIVMSG, or send commands with a trailing argument which you would not expect to have one).
This is IMHO a very huge flaw in the library and should be fixed before it goes 1.0.