From a211ddfcdbbfd5feba9c464b0a29621f74684348 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 17 Feb 2019 21:25:25 -0500 Subject: [PATCH 1/3] work around znc's broken nickserv support --- irc/idletimer.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/irc/idletimer.go b/irc/idletimer.go index e548d413..aa43a884 100644 --- a/irc/idletimer.go +++ b/irc/idletimer.go @@ -254,8 +254,12 @@ func (nt *NickTimer) Stop() { } func (nt *NickTimer) sendWarning() { - baseNotice := "Nickname is reserved; you must change it or authenticate to NickServ within %v" - nt.client.Notice(fmt.Sprintf(nt.client.t(baseNotice), nt.timeout)) + // ZNC's nickserv module will not detect this unless it is: + // 1. sent with prefix `nickserv` + // 2. contains the string "identify" + // 3. contains at least one of several other magic strings ("authenticate" works) + baseNotice := "Nickname is reserved; you must change it or authenticate (identify) to NickServ within %v" + nt.client.Send(nil, "NickServ", "NOTICE", nt.client.Nick(), fmt.Sprintf(nt.client.t(baseNotice), nt.timeout)) } func (nt *NickTimer) processTimeout() { From 729d4b377c24bfcf33b17f6da8a6f659ed9bc179 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 17 Feb 2019 22:47:41 -0500 Subject: [PATCH 2/3] revised string from discussion on ticket --- irc/idletimer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/idletimer.go b/irc/idletimer.go index aa43a884..e676cf16 100644 --- a/irc/idletimer.go +++ b/irc/idletimer.go @@ -258,7 +258,7 @@ func (nt *NickTimer) sendWarning() { // 1. sent with prefix `nickserv` // 2. contains the string "identify" // 3. contains at least one of several other magic strings ("authenticate" works) - baseNotice := "Nickname is reserved; you must change it or authenticate (identify) to NickServ within %v" + baseNotice := "This nickname is reserved. Please login within %v (using $b/msg NickServ IDENTIFY $b or SASL)" nt.client.Send(nil, "NickServ", "NOTICE", nt.client.Nick(), fmt.Sprintf(nt.client.t(baseNotice), nt.timeout)) } From 29c6db593a19ac7a6c990e6a37a5582075b90005 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 17 Feb 2019 22:59:13 -0500 Subject: [PATCH 3/3] fix missing Unescape call --- irc/idletimer.go | 8 ++------ irc/nickserv.go | 8 ++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/irc/idletimer.go b/irc/idletimer.go index e676cf16..4aceeb6a 100644 --- a/irc/idletimer.go +++ b/irc/idletimer.go @@ -8,6 +8,7 @@ import ( "sync" "time" + "github.com/goshuirc/irc-go/ircfmt" "github.com/oragono/oragono/irc/caps" ) @@ -254,12 +255,7 @@ func (nt *NickTimer) Stop() { } func (nt *NickTimer) sendWarning() { - // ZNC's nickserv module will not detect this unless it is: - // 1. sent with prefix `nickserv` - // 2. contains the string "identify" - // 3. contains at least one of several other magic strings ("authenticate" works) - baseNotice := "This nickname is reserved. Please login within %v (using $b/msg NickServ IDENTIFY $b or SASL)" - nt.client.Send(nil, "NickServ", "NOTICE", nt.client.Nick(), fmt.Sprintf(nt.client.t(baseNotice), nt.timeout)) + nt.client.Send(nil, "NickServ", "NOTICE", nt.client.Nick(), fmt.Sprintf(ircfmt.Unescape(nt.client.t(nsTimeoutNotice)), nt.timeout)) } func (nt *NickTimer) processTimeout() { diff --git a/irc/nickserv.go b/irc/nickserv.go index 2a2abcfb..f852b73a 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -26,6 +26,14 @@ func nsEnforceEnabled(config *Config) bool { return servCmdRequiresNickRes(config) && config.Accounts.NickReservation.AllowCustomEnforcement } +var ( + // ZNC's nickserv module will not detect this unless it is: + // 1. sent with prefix `nickserv` + // 2. contains the string "identify" + // 3. contains at least one of several other magic strings ("msg" works) + nsTimeoutNotice = `This nickname is reserved. Please login within %v (using $b/msg NickServ IDENTIFY $b or SASL)` +) + const nickservHelp = `NickServ lets you register and login to an account. To see in-depth help for a specific NickServ command, try: