From 56f500b2c916d8801daaa631cd9215263bb3de23 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 25 Aug 2008 15:43:46 +0000 Subject: Implement /who 1d t (search for who matches for users connected for a given time) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10278 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_who.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 561981df1..1ce4e4c28 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -89,7 +89,14 @@ bool CommandWho::whomatch(User* user, const char* matchtext) } else if (opt_away) match = InspIRCd::Match(user->awaymsg, matchtext, lowermap); + else if (opt_time) + { + long seconds = ServerInstance->Duration(matchtext); + // Okay, so time matching, we want all users connected `seconds' ago + if (user->age >= ServerInstance->Time() - seconds) + match = true; + } /* * Once the conditionals have been checked, only check dhost/nick/server -- cgit v1.2.3