From e54ae6dc770a85580c22d5b05351e1b5368e2c0b Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 15 Sep 2015 20:59:26 +0200 Subject: [PATCH] Service: Don't ghost if ghostDelay is set to 0. --- plugins/Services/config.py | 2 +- plugins/Services/plugin.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Services/config.py b/plugins/Services/config.py index f9272f583..4fe36bc05 100644 --- a/plugins/Services/config.py +++ b/plugins/Services/config.py @@ -83,7 +83,7 @@ conf.registerGlobalValue(Services, 'noJoinsUntilIdentified', joining +r channels that won't allow you to join unless you identify."""))) conf.registerGlobalValue(Services, 'ghostDelay', registry.PositiveInteger(60, _("""Determines how many seconds the bot will - wait between successive GHOST attempts."""))) + wait between successive GHOST attempts. Set this to 0 to disable GHOST."""))) conf.registerGlobalValue(Services, 'NickServ', ValidNickOrEmptyString('NickServ', _("""Determines what nick the 'NickServ' service has."""))) diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index 66764b30d..21450e46c 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -132,6 +132,8 @@ class Services(callbacks.Plugin): nickserv = self.registryValue('NickServ') password = self._getNickServPassword(nick) ghostDelay = self.registryValue('ghostDelay') + if not ghostDelay: + return if not nickserv or not password: s = 'Tried to ghost without a NickServ or password set.' self.log.warning(s) @@ -160,6 +162,8 @@ class Services(callbacks.Plugin): nickserv = self.registryValue('NickServ') password = self._getNickServPassword(nick) ghostDelay = self.registryValue('ghostDelay') + if not ghostDelay: + return if nick and nickserv and password and \ not ircutils.strEqual(nick, irc.nick): if irc.afterConnect and (self.sentGhost is None or