mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-10 12:59:22 +01:00
Services: Improve error on missing password or NickServ nick
This commit is contained in:
parent
fffdd82571
commit
06c88581ec
@ -124,9 +124,11 @@ class Services(callbacks.Plugin):
|
|||||||
return
|
return
|
||||||
nickserv = self.registryValue('NickServ', network=irc.network)
|
nickserv = self.registryValue('NickServ', network=irc.network)
|
||||||
password = self._getNickServPassword(nick, irc.network)
|
password = self._getNickServPassword(nick, irc.network)
|
||||||
if not nickserv or not password:
|
if not nickserv:
|
||||||
s = 'Tried to identify without a NickServ or password set.'
|
self.log.warning('Tried to identify without a NickServ set.')
|
||||||
self.log.warning(s)
|
return
|
||||||
|
if not password:
|
||||||
|
self.log.warning('Tried to identify without a password set.')
|
||||||
return
|
return
|
||||||
assert ircutils.strEqual(irc.nick, nick), \
|
assert ircutils.strEqual(irc.nick, nick), \
|
||||||
'Identifying with not normal nick.'
|
'Identifying with not normal nick.'
|
||||||
@ -150,16 +152,15 @@ class Services(callbacks.Plugin):
|
|||||||
ghostDelay = self.registryValue('ghostDelay', network=irc.network)
|
ghostDelay = self.registryValue('ghostDelay', network=irc.network)
|
||||||
if not ghostDelay:
|
if not ghostDelay:
|
||||||
return
|
return
|
||||||
if not nickserv or not password:
|
if not nickserv:
|
||||||
s = 'Tried to ghost without a NickServ or password set.'
|
self.log.warning('Tried to ghost without a NickServ set.')
|
||||||
self.log.warning(s)
|
return
|
||||||
|
if not password:
|
||||||
|
self.log.warning('Tried to ghost without a password set.')
|
||||||
return
|
return
|
||||||
if state.sentGhost and time.time() < (state.sentGhost + ghostDelay):
|
if state.sentGhost and time.time() < (state.sentGhost + ghostDelay):
|
||||||
self.log.warning('Refusing to send GHOST more than once every '
|
self.log.warning('Refusing to send GHOST more than once every '
|
||||||
'%s seconds.' % ghostDelay)
|
'%s seconds.' % ghostDelay)
|
||||||
elif not password:
|
|
||||||
self.log.warning('Not ghosting: no password set.')
|
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
self.log.info('Sending ghost (current nick: %s; ghosting: %s)',
|
self.log.info('Sending ghost (current nick: %s; ghosting: %s)',
|
||||||
irc.nick, nick)
|
irc.nick, nick)
|
||||||
|
Loading…
Reference in New Issue
Block a user