Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Properly split long IRC messages #29
This pull request adds handling of long IRC messages to the core. In contrast to the "splitlong.pl" plugin, multi-byte encoded and recoded messages are properly split.
To allow for this, a new function has been added to the server struct: "split_message". "split_message" returns a string array with the message splitted to substrings of a length that the server can handle. If a protocol module doesn't have any limit, it can simply set "split_message" to NULL.
The "MSG" chat command now calls "split_message" before "send_message", and emits "message own_public" / "message own_private" with each substring, so that the string splitting will be visible in the UI. In the IRC module, the "ME" and "ACTION" commands work in a similar way.
"split_message" in the IRC module uses "recode_split" which in turn uses iconv to properly split multi-byte encoded (and recoded) messages.
This pull request also adds two new settings: "split_line_start" and "split_line_end", analogous to "splitlong_line_start" and "splitlong_line_end" in "splitlong.pl".
This fixes issue #1.