From a3a535b1950bc7924099bce35075ab2f1d0c2290 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 29 Jan 2019 00:02:56 +0000 Subject: [PATCH] Delete a user's `'access'` channel setting when they have no permissions left (channel_access.py) --- modules/channel_access.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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:])))