-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All of the below should apply: 1. Input limit uses multi-byte check. One thing I'm not sure about is if servers that provide their limits are based off runes, or just based off bytes, but the current implementation uses rune length (to a single multi-byte character counts as single character). 2. Tries to keep colors/backgrounds/color resets/etc between splits. It's not perfect, but it should work "good enough". 3. If a very long single word is split, it will prefer to keep it together (but on another line) rather than splitting off small chunks at the end (e.g. URLs). 4. Default is word spliting, and if a word is above 30 characters, I try to split be special characters (e.g. `lalkmadlkmasdlka-adasdasdasdasd` would split at `-`). 5. Worst case, it splits at the exact point necessary to make it fit, if none of the above apply and the entire word is above the maximum length. As far as logic changes: 1. girc sets a default max line length of **510**, but some of this is subtracted with prefix padding, user length, host length, etc. Some of the subtractions aren't smart checks, just "assume a host will be this long" rather than keeping track of the actual sizes. There might be room for improvement on this item. 2. Servers can raise this limit with ISUPPORT or similar -- girc should respect that raised limit. 3. During the connection `Send` method, we invoke `Event.split` -- note that not all events are split (only `PRIVMSG` and `NOTICE` for now, `JOIN`'s have always had custom logic to split already). Could apply the logic to all commands, but there are some commands that **will not support splitting**, so prefer to be conservative for now. Also merged in changes from branch `bugfix/issue-50`, which includes the swap to a ctx group for keeping track of the core handlers (ping/read/send/etc).
- Loading branch information
Showing
24 changed files
with
743 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,12 @@ type Tags map[string]string | |
|
||
// ParseTags parses out the key-value map of tags. raw should only be the tag | ||
// data, not a full message. For example: | ||
// @aaa=bbb;ccc;example.com/ddd=eee | ||
// | ||
// @aaa=bbb;ccc;example.com/ddd=eee | ||
// | ||
// NOT: | ||
// @aaa=bbb;ccc;example.com/ddd=eee :[email protected] PRIVMSG me :Hello | ||
// | ||
// @aaa=bbb;ccc;example.com/ddd=eee :[email protected] PRIVMSG me :Hello | ||
// | ||
// Technically, there is a length limit of 4096, but the server should reject | ||
// tag messages longer than this. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.