From 06c88581ec5b6547de0012a75dfed6316ceda011 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 18 Nov 2023 22:02:36 +0100 Subject: [PATCH] Services: Improve error on missing password or NickServ nick --- plugins/Services/plugin.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index b3efd785d..b07ba088e 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -124,9 +124,11 @@ class Services(callbacks.Plugin): return nickserv = self.registryValue('NickServ', network=irc.network) password = self._getNickServPassword(nick, irc.network) - if not nickserv or not password: - s = 'Tried to identify without a NickServ or password set.' - self.log.warning(s) + if not nickserv: + self.log.warning('Tried to identify without a NickServ set.') + return + if not password: + self.log.warning('Tried to identify without a password set.') return assert ircutils.strEqual(irc.nick, nick), \ 'Identifying with not normal nick.' @@ -150,16 +152,15 @@ class Services(callbacks.Plugin): ghostDelay = self.registryValue('ghostDelay', network=irc.network) if not ghostDelay: return - if not nickserv or not password: - s = 'Tried to ghost without a NickServ or password set.' - self.log.warning(s) + if not nickserv: + self.log.warning('Tried to ghost without a NickServ set.') + return + if not password: + self.log.warning('Tried to ghost without a password set.') return if state.sentGhost and time.time() < (state.sentGhost + ghostDelay): self.log.warning('Refusing to send GHOST more than once every ' '%s seconds.' % ghostDelay) - elif not password: - self.log.warning('Not ghosting: no password set.') - return else: self.log.info('Sending ghost (current nick: %s; ghosting: %s)', irc.nick, nick)