Skip to content

Commit 06c8858

Browse files
committed
Services: Improve error on missing password or NickServ nick
1 parent fffdd82 commit 06c8858

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

plugins/Services/plugin.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ def _doIdentify(self, irc, nick=None):
124124
return
125125
nickserv = self.registryValue('NickServ', network=irc.network)
126126
password = self._getNickServPassword(nick, irc.network)
127-
if not nickserv or not password:
128-
s = 'Tried to identify without a NickServ or password set.'
129-
self.log.warning(s)
127+
if not nickserv:
128+
self.log.warning('Tried to identify without a NickServ set.')
129+
return
130+
if not password:
131+
self.log.warning('Tried to identify without a password set.')
130132
return
131133
assert ircutils.strEqual(irc.nick, nick), \
132134
'Identifying with not normal nick.'
@@ -150,16 +152,15 @@ def _doGhost(self, irc, nick=None):
150152
ghostDelay = self.registryValue('ghostDelay', network=irc.network)
151153
if not ghostDelay:
152154
return
153-
if not nickserv or not password:
154-
s = 'Tried to ghost without a NickServ or password set.'
155-
self.log.warning(s)
155+
if not nickserv:
156+
self.log.warning('Tried to ghost without a NickServ set.')
157+
return
158+
if not password:
159+
self.log.warning('Tried to ghost without a password set.')
156160
return
157161
if state.sentGhost and time.time() < (state.sentGhost + ghostDelay):
158162
self.log.warning('Refusing to send GHOST more than once every '
159163
'%s seconds.' % ghostDelay)
160-
elif not password:
161-
self.log.warning('Not ghosting: no password set.')
162-
return
163164
else:
164165
self.log.info('Sending ghost (current nick: %s; ghosting: %s)',
165166
irc.nick, nick)

0 commit comments

Comments
 (0)