Compare nicks by exact case everywhere (closes #128)
check / check (push) Waiting to run

README.md rules that nicks are case-sensitive, but the IRC listener's
relay and user MODE on both transports compared nicks ignoring case:
an IRC listener user alice never saw a PRIVMSG, NOTICE, JOIN, PART,
NICK or QUIT from Alice, and MODE Alice from alice was taken as her
own nick. These checks now use ==.

Tests cover alice receiving each of these from Alice, MODE Alice from
alice getting 502 on both transports, and Alice registering while
alice exists. README.md drops the text that described the old
behaviour.

Model: opus-5-5
This commit is contained in:
2026-10-20 14:10:03 +00:00
parent 3c725a9ca8
commit 0de75dc0b3
8 changed files with 66 additions and 31 deletions
+5 -5
View File
@@ -195,7 +195,7 @@ func (c *Conn) deliverTextMessage(
c.mu.Unlock()
// Don't echo our own messages back.
if strings.EqualFold(from, nick) {
if from == nick {
return
}
@@ -217,7 +217,7 @@ func (c *Conn) deliverJoin(msg *db.IRCMessage) {
// Don't echo our own JOINs (we already sent them
// during joinChannel).
if strings.EqualFold(msg.From, nick) {
if msg.From == nick {
return
}
@@ -233,7 +233,7 @@ func (c *Conn) deliverPart(msg *db.IRCMessage, text string) {
nick := c.nick
c.mu.Unlock()
if strings.EqualFold(msg.From, nick) {
if msg.From == nick {
return
}
@@ -258,7 +258,7 @@ func (c *Conn) deliverNickChange(
nick := c.nick
c.mu.Unlock()
if strings.EqualFold(msg.From, nick) {
if msg.From == nick {
return
}
@@ -276,7 +276,7 @@ func (c *Conn) deliverQuitMsg(
nick := c.nick
c.mu.Unlock()
if strings.EqualFold(msg.From, nick) {
if msg.From == nick {
return
}