jamesots/irc_client — pull request #3 by didrocks (2014-04-24 10:25:31+00:00)
Title: Enable splitting a message sent to an IRC server 

When a bot message is too long, the request is truncated by the IRC server.
The limit seems to be (for the whole message) around 450 from empiric tests,
this includes as well the command and channel (so, it depends on where and what
you are sending). Looking at other FLOSS like weechat and irssi, they are
splitting at 411 for the core message itself. Using the same value.

The split happens before last available whitespace. In case a continued char
entry without any space exceed LIMIT_MESSAGE_SIZE on its own, we bindly split
it, but keep it in its own message request.

Add some tests for this as well.

Some tests have quite some long lines, I was unsure how you would like them to be split to still be comprehensive. Feel free to suggest or split them yourself if you feel too :)
Do not hesitate for any suggestion if you think the code needs enhancement.