Service: Don't ghost if ghostDelay is set to 0.

This commit is contained in:
Valentin Lorentz 2015-09-15 20:59:26 +02:00
parent 7c0e9c77d4
commit e54ae6dc77
2 changed files with 5 additions and 1 deletions

View File

@ -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.""")))

View File

@ -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