Skip to content

Commit

Permalink
Merge pull request #397 from slingamn/znc
Browse files Browse the repository at this point in the history
work around znc's broken nickserv support
  • Loading branch information
DanielOaks authored Feb 18, 2019
2 parents 09909e3 + 29c6db5 commit 329183d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions irc/idletimer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"
"time"

"github.com/goshuirc/irc-go/ircfmt"
"github.com/oragono/oragono/irc/caps"
)

Expand Down Expand Up @@ -254,8 +255,7 @@ 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))
nt.client.Send(nil, "NickServ", "NOTICE", nt.client.Nick(), fmt.Sprintf(ircfmt.Unescape(nt.client.t(nsTimeoutNotice)), nt.timeout))
}

func (nt *NickTimer) processTimeout() {
Expand Down
8 changes: 8 additions & 0 deletions irc/nickserv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <password>$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:
Expand Down

0 comments on commit 329183d

Please sign in to comment.