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

search/check_url_callbacks() ignore disable_commands #2281

Open
half-duplex opened this issue May 16, 2022 · 1 comment
Open

search/check_url_callbacks() ignore disable_commands #2281

half-duplex opened this issue May 16, 2022 · 1 comment
Labels
Bug Things to squish; generally used for issues

Comments

@half-duplex
Copy link
Member

url.py uses both bot.search_url_callbacks() and bot.rules.check_url_callback() to see if a URL has been handled by another plugin.

These functions ignoring config[channel].disable_commands means that if a channel has disabled e.g. {"reddit":["post_or_comment_info"]} and a user sends a reddit post link, url.py will not auto-title it.

In some cases this may be desirable ("we have a bot that does something entirely different with these URLs"), but in some it may not be ("we don't like the colors in sopel-youtube" (fixed, but you get the idea)). I'm not sure which way to go on that, unless we make .urlexclude per-channel.

More impactfully, this also makes it difficult for url.py's .title command to behave as expected. Currently, it lets Sopel's url handling code dispatch the callback to e.g. reddit.py, and skips any handling of that URL - but it doesn't know that the callback has been disabled in this channel, and that it should dispatch the callback itself. The current behavior is that .title for a disabled-command URL is a no-op.

Environment

  • Sopel .version: cea42e1
  • Sopel installed via: git/pip
@half-duplex half-duplex added the Bug Things to squish; generally used for issues label May 16, 2022
@dgw
Copy link
Member

dgw commented Jun 1, 2023

The old bot.register_url_callback() method and its friends are deprecated, and according to GitHub code search results for org:sopel-irc register_url_callback, neither core plugins nor first-party plugins use them any more.

Rather than spend any time fixing this, I motion we just let it be until #2436 kills off the last vestiges of an obsolete system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Things to squish; generally used for issues
Projects
None yet
Development

No branches or pull requests

2 participants