Skip to content
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

Support invite-notify CAP #2637

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support invite-notify CAP #2637

wants to merge 2 commits into from

Conversation

dgw
Copy link
Member

@dgw dgw commented Oct 21, 2024

Description

Sopel now requests the invite-notify CAP. I couldn't think of anything useful for it to do with the notifications, except to log them like other channel events are, at the INFO level. A test case added for coretasks checks the expected log message.

The admin plugin's invite_join handler now ignores INVITEs not targeted at the bot. A new builtins/test_builtins_admin.py test suite validates its invite-handling behavior. Of the four test cases, test_invite_accept_not_us was the only one not already passing prior to patching the plugin.

Progresses #971.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
  • I have tested the functionality of the things this change touches

Notes

Discovering some other old branches that I'd never created PRs for got me thinking, and I looked in the Branches list for other things that I might've forgotten about. This was one of them. Then I realized that admin would be broken-ish without changes, so I added that to the old branch before PRing it.

Initially, I'm targeting this feature for Sopel 8.1—but it has potential as a "breaking change" for third-party plugin code that also listens for the 'INVITE' event, if (like admin) they aren't checking the target nick.

In the very most cautious of worlds, we'd have to hold this until 9.0. I'd rather not, though, if we can consider 'INVITE' handlers niche enough that it's not worth delaying.

dgw added 2 commits November 30, 2023 23:19
Sopel does nothing with this beyond emitting an INFO-level log event,
but plugins might do something more interesting with these.
Enabling the `invite-notify` CAP means that the INVITE verb can contain
other nicks, not only Sopel's. The `admin` plugin has to ignore these.

As a small side project, this also adds test cases for the auto-accept
feature. `test_invite_accept_not_us` fails prior to the associated patch
for `sopel/builtins/admin.py`, because the bot blindly joins `#boudoir`
even though `Anne` was the one invited, not TestBot.
@dgw dgw added this to the 8.1.0 milestone Oct 21, 2024
@dgw dgw requested a review from a team October 21, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant