~emersion/soju

ecf35187fa8305808426038c3a71a191ed59c61f — Simon Ser 6 months ago 3237bde
Make NickServ detection casemapping-aware
2 files changed, 4 insertions(+), 4 deletions(-)

M downstream.go
M upstream.go
M downstream.go => downstream.go +1 -1
@@ 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)
			}


M upstream.go => upstream.go +3 -3
@@ 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