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

Fix the channels option #31

Merged
merged 1 commit into from Mar 5, 2020
Merged

Fix the channels option #31

merged 1 commit into from Mar 5, 2020

Conversation

ghost
Copy link

@ghost ghost commented Mar 4, 2020

When python.notification_center.channels is set as "" in ~/.weechat/plugins.conf, notification_center.py doesn't work.
I investigated this issue and noticed if channel in channel_whitelist: of line 63 returns True although channel whitelist is not registered.
In Python, "".split(',') returns [''] and "" in [''] returns True....

To avoid the case, condition is set.

$ python
Python 3.8.1 (default, Feb  8 2020, 23:24:07)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "" in []
False
>>> "" in ['']
True
>>> whitelist = "".split(',')
>>> print (whitelist)
['']
>>> "" in whitelist
True

I confirmed the edited version of notification-center.py works in weechat.
If you would like to ask me more in detail, please let me know.

@sindresorhus sindresorhus changed the title Modify channel_whitelist Fix the channels option Mar 5, 2020
@sindresorhus sindresorhus merged commit 97ef6e6 into sindresorhus:master Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant