New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial work towards moving away from Event.Trailing (closes #5) #36
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36 +/- ##
==========================================
+ Coverage 56.04% 56.18% +0.13%
==========================================
Files 13 13
Lines 2339 2321 -18
==========================================
- Hits 1311 1304 -7
+ Misses 921 912 -9
+ Partials 107 105 -2
Continue to review full report at Codecov.
|
|
First of all: Thanks for this patch, this is really useful to me. I did some quick tests and the first thing I noticed is that if ctcp.Command == CTCP_ACTION {
return fmt.Sprintf("[%s] **%s** %s", strings.Join(e.Params, ","), ctcp.Source.Name, ctcp.Text), true
}and should prorably be changed to: if ctcp.Command == CTCP_ACTION {
return fmt.Sprintf("[%s] **%s** %s", strings.Join(e.Params[0:len(e.Params)-1], ","), ctcp.Source.Name, ctcp.Text), true
}Otherwise they are formated as Might also be nice to add a helper method for getting all parameters except the trailing one (e.g. |
|
@nmeum -- Latest commit should have fixes for that and TOPIC's. I did decide to rename I am not sure I want to add a helper to grab all but the last, because it's both not used too frequently (I think this is the only occurrence actually), but it's also not beneficial without also keeping track of if the last item was a trailing item (which means adding a field in |
This makes a few code parts simpler and also fixes others. For instance, in the handleKick function we didn't check for Event.Trailing at all. Meaning a `KICK :<name>` instead of `KICK <name>` message would not have been parsed properly. See also: lrstanley/girc#36
|
@42wim have you had a chance to test this? |
|
@lrstanley sorry, this issue was off my radar :( |
This makes a few code parts simpler and also fixes others. For instance, in the handleKick function we didn't check for Event.Trailing at all. Meaning a `KICK :<name>` instead of `KICK <name>` message would not have been parsed properly. See also: lrstanley/girc#36
Closes: #35
Closes: #19
See also: #15 (comment)
From: https://modern.ircdocs.horse/
Essentially,
Event.Trailingis now just an additional entry in theEvent.Paramsslice.I'm still opting to have the concept of
Trailingas a semantic wrapper (and has nothing to do with the rfc's use of "trailing").Event.Trailing(), which now just returns the last parameter/argument (fromEvent.Paramsdirectly), which will help as it is much more frequent to get the last element, than any other element (andEvent.Params[len(Event.Params)-1]is very verbose). The other benefit is it defaults to an empty string. Maybe I'll rename it toLast?This probably has bugs in it. Tests run fine, did some initial connections to servers, but I'd like some contributors to test this out before I merge into master:
Also, @qaisjp, this has that spelling correction.
The text was updated successfully, but these errors were encountered: