-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
irc: rework parsing of modestrings #2131
Merged
Merged
Commits on Nov 7, 2021
-
irc: add modes submodule to handle MODE messages
Co-authored-by: dgw <dgw@technobabbl.es>
Configuration menu - View commit details
-
Copy full SHA for d88c3de - Browse repository at this point
Copy the full SHA d88c3deView commit details -
Configuration menu - View commit details
-
Copy full SHA for c9738e0 - Browse repository at this point
Copy the full SHA c9738e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 611068d - Browse repository at this point
Copy the full SHA 611068dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed6c298 - Browse repository at this point
Copy the full SHA ed6c298View commit details -
Configuration menu - View commit details
-
Copy full SHA for c171bfc - Browse repository at this point
Copy the full SHA c171bfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for c8c43fa - Browse repository at this point
Copy the full SHA c8c43faView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbee851 - Browse repository at this point
Copy the full SHA cbee851View commit details -
bot, coretasks: add bot.modeparser
Instead of creating an instance of `ModeParser` at each MODE event, the bot has a `modeparser` attribute with appropriate default values for its chanmodes, privileges, and param types. For that to work, when the bot received new ISUPPORT parameters, it updates the chanmodes and privileges of the mode parser if necessary. This required to adapt the list of default modes, as `a` and `q` are more commonly used as privilege rather than modes. Tests have been updated to manually update the modeparser. This may require new methods on the test IRC server to streamline an ISUPPORT configuration, because right now it's a bit too manual.
Configuration menu - View commit details
-
Copy full SHA for 6d9a176 - Browse repository at this point
Copy the full SHA 6d9a176View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd86adf - Browse repository at this point
Copy the full SHA cd86adfView commit details -
irc: improve behavior of ModeParser.parse method
Several improvements of the ModeParser.parse method, which was renamed from ModeParser.parse_modestring (renamed to prevent name conflict with sopel.irc.modes.parse_modestring function). The method ModeParser.get_mode_info doesn't try to parse privileges anymore, which make it more type-safe as the letter is now str instead of Optional[str]. This makes the logic in ModeParser.parse a little different in a good way. Overall, a better type definition helped built a better interface with less potential for issues later. Functionnal tests for ModeParser.parse are kept the same, as nothing has change on this side. Thanks to mal who caught the type inconsistency in the first place!
Configuration menu - View commit details
-
Copy full SHA for 96043ea - Browse repository at this point
Copy the full SHA 96043eaView commit details -
coretasks: add comments and link to spec about MODE handling
Co-authored-by: mal <mal@sec.gd>
Configuration menu - View commit details
-
Copy full SHA for ee5dca2 - Browse repository at this point
Copy the full SHA ee5dca2View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.