* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
public:
ModuleSafeList(InspIRCd* Me) : Module(Me)
{
- OnRehash(NULL, "");
+ OnRehash(NULL);
Implementation eventlist[] = { I_OnBufferFlushed, I_OnPreCommand, I_OnCleanup, I_OnUserQuit, I_On005Numeric, I_OnRehash };
ServerInstance->Modules->Attach(eventlist, this, 6);
}
{
}
- virtual void OnRehash(User* user, const std::string ¶meter)
+ virtual void OnRehash(User* user)
{
ConfigReader MyConf(ServerInstance);
ThrottleSecs = MyConf.ReadInteger("safelist", "throttle", "60", 0, true);
* OnPreCommand()
* Intercept the LIST command.
*/
- virtual int OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
+ virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
- return 0;
+ return MOD_RES_PASSTHRU;
if (command == "LIST")
{
return this->HandleList(parameters, user);
}
- return 0;
+ return MOD_RES_PASSTHRU;
}
/*
* HandleList()
* Handle (override) the LIST command.
*/
- int HandleList(const std::vector<std::string> ¶meters, User* user)
+ ModResult HandleList(const std::vector<std::string> ¶meters, User* user)
{
int pcnt = parameters.size();
int minusers = 0, maxusers = 0;
user->WriteServ("NOTICE %s :*** Server load is currently too heavy. Please try again later.", user->nick.c_str());
user->WriteNumeric(321, "%s Channel :Users Name",user->nick.c_str());
user->WriteNumeric(323, "%s :End of channel list.",user->nick.c_str());
- return 1;
+ return MOD_RES_DENY;
}
/* First, let's check if the user is currently /list'ing */
if (ld)
{
/* user is already /list'ing, we don't want to do shit. */
- return 1;
+ return MOD_RES_DENY;
}
/* Work around mIRC suckyness. YOU SUCK, KHALED! */
user->WriteServ("NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick.c_str());
user->WriteNumeric(321, "%s Channel :Users Name",user->nick.c_str());
user->WriteNumeric(323, "%s :End of channel list.",user->nick.c_str());
- return 1;
+ return MOD_RES_DENY;
}
delete last_list_time;
global_listing++;
- return 1;
+ return MOD_RES_DENY;
}
virtual void OnBufferFlushed(User* user)