put permission control on !serverignore, don't rely on setting default of None

This commit is contained in:
jesopo 2019-05-06 17:16:48 +01:00
parent a368bc018a
commit 96550eaef0

View file

@ -368,10 +368,13 @@ class Module(ModuleManager.BaseModule):
@utils.hook("received.command.serverignore", in_args=1) @utils.hook("received.command.serverignore", in_args=1)
def server_ignore(self, event): def server_ignore(self, event):
"""
:permission: server-ignore
"""
command = event["args_split"][0].lower() command = event["args_split"][0].lower()
setting = "ignore-%s" % command setting = "ignore-%s" % command
if event["server"].get_setting(setting): if event["server"].get_setting(setting, False):
event["stderr"].write("I'm already ignoring '%s' for %s" % event["stderr"].write("I'm already ignoring '%s' for %s" %
(command, str(event["server"]))) (command, str(event["server"])))
else: else: