* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
public:
ModuleBlockAmsg(InspIRCd* Me) : Module(Me)
{
- this->OnRehash(NULL,"");
+ this->OnRehash(NULL);
Implementation eventlist[] = { I_OnRehash, I_OnPreCommand, I_OnCleanup };
ServerInstance->Modules->Attach(eventlist, this, 3);
}
return Version("$Id$",VF_VENDOR,API_VERSION);
}
- virtual void OnRehash(User* user, const std::string ¶meter)
+ virtual void OnRehash(User* user)
{
ConfigReader Conf(ServerInstance);
action = IBLOCK_KILLOPERS;
}
- 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)
{
// Don't do anything with unregistered users, or remote ones.
if(!user || (user->registered != REG_ALL) || !IS_LOCAL(user))
- return 0;
+ return MOD_RES_PASSTHRU;
// We want case insensitive command comparison.
// Add std::string contructor for irc::string :x
*/
if(targets == 0)
{
- return 0;
+ return MOD_RES_PASSTHRU;
}
userchans = user->chans.size();
{
// Block it...
if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS)
- ServerInstance->SNO->WriteToSnoMask('A', "%s had an /amsg or /ame denied", user->nick.c_str());
+ ServerInstance->SNO->WriteToSnoMask('a', "%s had an /amsg or /ame denied", user->nick.c_str());
if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS)
ServerInstance->Users->QuitUser(user, "Global message (/amsg or /ame) detected");
else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick.c_str());
- return 1;
+ return MOD_RES_DENY;
}
if(m)
user->Extend("amsgblock", (char*)m);
}
}
- return 0;
+ return MOD_RES_PASSTHRU;
}
void OnCleanup(int target_type, void* item)