From ecf35187fa8305808426038c3a71a191ed59c61f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 30 Mar 2021 12:28:45 +0200 Subject: [PATCH] Make NickServ detection casemapping-aware --- downstream.go | 2 +- upstream.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/downstream.go b/downstream.go index f02e384..3fa4ccc 100644 --- a/downstream.go +++ b/downstream.go @@ -1682,7 +1682,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { return err } - if upstreamName == "NickServ" { + if uc.network.casemap(upstreamName) == "nickserv" { dc.handleNickServPRIVMSG(uc, text) } diff --git a/upstream.go b/upstream.go index 82bd3b6..064ce2b 100644 --- a/upstream.go +++ b/upstream.go @@ -1734,14 +1734,14 @@ func (uc *upstreamConn) appendLog(entity string, msg *irc.Message) (msgID string if uc.user.msgStore == nil { return "" } - if entity == "NickServ" { + + entityCM := uc.network.casemap(entity) + if entityCM == "nickserv" { // The messages sent/received from NickServ may contain // security-related information (like passwords). Don't store these. return "" } - entityCM := uc.network.casemap(entity) - if !uc.network.delivered.HasTarget(entity) { // This is the first message we receive from this target. Save the last // message ID in delivery receipts, so that we can send the new message