diff options
| author | 2019-01-29 00:02:56 +0000 | |
|---|---|---|
| committer | 2019-01-29 00:02:56 +0000 | |
| commit | a3a535b1950bc7924099bce35075ab2f1d0c2290 (patch) | |
| tree | a1d26b0d17b147276d16d53127d70ca913a319cb /modules/channel_access.py | |
| parent | IRCUser.User objects don't have `.id`, they have `.get_id()` (channel_access.py) (diff) | |
| signature | ||
Delete a user's `'access'` channel setting when they have no permissions left
(channel_access.py)
Diffstat (limited to 'modules/channel_access.py')
| -rw-r--r-- | modules/channel_access.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/channel_access.py b/modules/channel_access.py index c2d4c668..30bd00c4 100644 --- a/modules/channel_access.py +++ b/modules/channel_access.py @@ -57,6 +57,10 @@ class Module(ModuleManager.BaseModule): raise utils.EventError("%s does not have '%s' permission" % (target.nickname, acc)) access.remove(acc) - event["target"].set_user_setting(target.get_id(), "access", access) + if access: + event["target"].set_user_setting(target.get_id(), "access", + access) + else: + event["target"].del_user_setting(target.get_id(), "access") event["stdout"].write("Removed permission from %s: %s" % ( target.nickname, " ".join(event["args_split"][2:]))) |
