1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-11-01 14:33:00 +00:00

Make IRC_WHO also search username/servername/hostname.

Dana Dahlstrom reported that IRC_WHO did not follow
RFC 2812, Section 3.6.1. Specifically:

- IRC_WHO did not send "G" flag instead if "H" if client was away
- did not search username/servername/hostname etc. if argument
  was not a channel.

Fix all of the above and tidy things up a bit.
Also add IRC_WHO test script contributed by Dana.
This commit is contained in:
Florian Westphal
2008-02-11 11:06:31 +00:00
parent c634303765
commit 4d152b771e
6 changed files with 276 additions and 114 deletions

View File

@@ -9,7 +9,7 @@
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
#
# $Id: Makefile.am,v 1.15 2007/11/18 15:07:16 alex Exp $
# $Id: Makefile.am,v 1.16 2008/02/11 11:06:32 fw Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
@@ -21,6 +21,7 @@ EXTRA_DIST = \
start-server.sh stop-server.sh tests.sh stress-server.sh \
test-loop.sh wait-tests.sh \
connect-test.e channel-test.e mode-test.e \
who-away-test.e
stress-A.e stress-B.e check-idle.e \
ngircd-test.conf
@@ -47,6 +48,10 @@ channel-test: tests.sh
rm -f channel-test
ln -s $(srcdir)/tests.sh channel-test
who-away-test: tests.sh
rm -f who-away-test
ln -s $(srcdir)/tests.sh who-away-test
mode-test: tests.sh
rm -f mode-test
ln -s $(srcdir)/tests.sh mode-test
@@ -54,6 +59,7 @@ mode-test: tests.sh
TESTS = start-server.sh \
connect-test \
channel-test \
who-away-test \
mode-test \
stress-server.sh \
stop-server.sh

View File

@@ -0,0 +1,100 @@
# $Id: who-away-test.e,v 1.1 2008/02/11 11:06:32 fw Exp $
spawn telnet localhost 6789
expect {
timeout { exit 1 }
"Connected"
}
send "nick nick\r"
send "user user . . :Real Name\r"
expect {
timeout { exit 1 }
"376"
}
send "who\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "who 0\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "who *\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "away :testing\r"
expect {
timeout { exit 1 }
"306 nick"
}
send "who localhost\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name"
}
send "who ngircd.test.server\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name"
}
send "who Real?Name\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name"
}
send "who nick\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name"
}
send "away\r"
expect {
timeout { exit 1 }
"305 nick"
}
send "who *cal*ho??\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "who *.server\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "who Real*me\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "who n?c?\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name"
}
send "quit\r"
expect {
timeout { exit 1 }
"Connection closed"
}
# -eof-