Services: allow adjusting GHOST command

Anope 2.x has renamed this to /ns recover

Closes GH-1510
This commit is contained in:
James Lu 2022-07-09 13:39:44 -07:00 committed by Val Lorentz
parent d372d55c05
commit 21a2ace7a1
2 changed files with 7 additions and 2 deletions

View File

@ -86,6 +86,10 @@ conf.registerNetworkValue(Services, 'noJoinsUntilIdentified',
conf.registerNetworkValue(Services, 'ghostDelay',
registry.NonNegativeInteger(60, _("""Determines how many seconds the bot will
wait between successive GHOST attempts. Set this to 0 to disable GHOST.""")))
conf.registerNetworkValue(Services, 'ghostCommand',
registry.String("GHOST", _("""Determines the NickServ command to use for GHOST. If the network
you're using runs Anope, set this to "RECOVER". If the network you're using runs Atheme,
set this to "GHOST" or "REGAIN".""")))
conf.registerNetworkValue(Services, 'NickServ',
ValidNickOrEmptyString('NickServ', _("""Determines what nick the 'NickServ' service
has.""")))

View File

@ -162,7 +162,8 @@ class Services(callbacks.Plugin):
else:
self.log.info('Sending ghost (current nick: %s; ghosting: %s)',
irc.nick, nick)
ghost = 'GHOST %s %s' % (nick, password)
ghostCommand = self.registryValue('ghostCommand', network=irc.network)
ghost = '%s %s %s' % (ghostCommand, nick, password)
# Ditto about the sendMsg (see _doIdentify).
irc.sendMsg(ircmsgs.privmsg(nickserv, ghost))
state.sentGhost = time.time()
@ -297,7 +298,7 @@ class Services(callbacks.Plugin):
elif irc.isChannel(msg.args[0]):
# Atheme uses channel-wide notices for alerting channel access
# changes if the FANTASY or VERBOSE setting is on; we can suppress
# these 'unexpected notice' warnings since they're not really
# these 'unexpected notice' warnings since they're not really
# important.
pass
else: