From 21a2ace7a1410cf1c449a00b4d18d18c3946f18c Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 9 Jul 2022 13:39:44 -0700 Subject: [PATCH] Services: allow adjusting GHOST command Anope 2.x has renamed this to /ns recover Closes GH-1510 --- plugins/Services/config.py | 4 ++++ plugins/Services/plugin.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/Services/config.py b/plugins/Services/config.py index 3c324812d..04fa08ffe 100644 --- a/plugins/Services/config.py +++ b/plugins/Services/config.py @@ -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."""))) diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index 799ac5771..3087804b2 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -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: