Module: ngircd.git Branch: master Commit: 39412d648652b3fcb387cf04bf7fa9004cfcd8ba URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=39412...
Author: Alexander Barton alex@barton.de Date: Sat Jan 21 13:21:36 2012 +0100
PRIVMSG/NOTICE: handle nick!user@host masks case-insensitive
And enhance our test suite to check this a little bit better :-)
---
src/ngircd/irc.c | 4 ++-- src/testsuite/message-test.e | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index 5af7939..9508ecc 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -440,8 +440,8 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) Client_Type(cl) != CLIENT_SERVICE) continue; if (nick != NULL && host != NULL) { - if (strcmp(nick, Client_ID(cl)) == 0 && - strcmp(user, Client_User(cl)) == 0 && + if (strcasecmp(nick, Client_ID(cl)) == 0 && + strcasecmp(user, Client_User(cl)) == 0 && strcasecmp(host, Client_HostnameCloaked(cl)) == 0) break; else diff --git a/src/testsuite/message-test.e b/src/testsuite/message-test.e index eb26ac4..d0ffcef 100644 --- a/src/testsuite/message-test.e +++ b/src/testsuite/message-test.e @@ -35,7 +35,7 @@ expect { "@* PRIVMSG nick :test\r*@* PRIVMSG nick :test" }
-send "privmsg nick,#testChannel,nick :test\r" +send "privmsg Nick,#testChannel,nick :test\r" expect { timeout { exit 1 } "@* PRIVMSG nick :test\r*401*@* PRIVMSG nick :test" @@ -47,7 +47,7 @@ expect { "401" }
-send "privmsg ~user@ngircd.test.server :test\r" +send "privmsg ~UsEr@ngIRCd.Test.Server :test\r" expect { timeout { exit 1 } "@* PRIVMSG nick :test" @@ -65,7 +65,7 @@ expect { # "@* PRIVMSG nick :test" #} # -#send "privmsg nick!~user@localhost :test\r" +#send "privmsg Nick!~User@LocalHost :test\r" #expect { # timeout { exit 1 } # "@* PRIVMSG nick :test"