- if ((ServerInstance->Config->MaxWhoResults && (whoresults.size() <= (size_t)ServerInstance->Config->MaxWhoResults)) || opt_unlimit)
- {
- for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++)
- user->WriteServ(*n);
- user->WriteNumeric(315, "%s %s :End of /WHO list.",user->nick.c_str(), *parameters[0].c_str() ? parameters[0].c_str() : "*");
- return CMD_SUCCESS;
- }
- else
- {
- /* BZZT! Too many results. */
- user->WriteNumeric(315, "%s %s :Too many results",user->nick.c_str(), parameters[0].c_str());
- return CMD_FAILURE;
- }
+ for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++)
+ user->WriteServ(*n);
+ user->WriteNumeric(315, "%s %s :End of /WHO list.",user->nick.c_str(), *parameters[0].c_str() ? parameters[0].c_str() : "*");
+
+ // Penalize the user a bit for large queries
+ // (add one unit of penalty per 200 results)
+ if (IS_LOCAL(user))
+ IS_LOCAL(user)->CommandFloodPenalty += whoresults.size() * 5;
+ return CMD_SUCCESS;