void init()
{
Implementation eventlist[] = { I_OnPreCommand, I_OnRehash };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
OnRehash(NULL);
}
ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line)
{
- if (!IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS"))
+ if (validated && !IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS"))
{
user->WriteServ("NOTICE %s :/%s has been disabled; visit %s", user->nick.c_str(), command.c_str(), url.c_str());
return MOD_RES_DENY;