From 9b56909a3b00b4dc25dfb27ccbf0859d2fd5eb7a Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 May 2007 16:08:14 +0000 Subject: Slightly modify WHO p to allow a port range, e.g. "WHO 6660-6669,7000,7001 p" would find all users on ports 6660 thru 6669, 7000 and 7001. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6958 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_who.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp index ff29447fb..df209991a 100644 --- a/src/cmd_who.cpp +++ b/src/cmd_who.cpp @@ -88,7 +88,13 @@ bool cmd_who::whomatch(userrec* user, const char* matchtext) else { if (opt_port) - port = (user->GetPort() == ConvToInt(matchtext)); + { + irc::portparser portrange(matchtext, false); + long portno = -1; + while ((portno = portrange.GetToken())) + if (portno == user->GetPort()) + port = true; + } else { if (opt_away) -- cgit v1.2.3