ModuleBlockCAPS(InspIRCd* Me) : Module::Module(Me)
{
- OnRehash("");
+ OnRehash(NULL,"");
bc = new BlockCaps(ServerInstance);
- ServerInstance->AddMode(bc, 'P');
+ if (!ServerInstance->AddMode(bc, 'P'))
+ throw ModuleException("Could not add new modes!");
}
void Implements(char* List)
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string ¶m)
+ virtual void OnRehash(userrec* user, const std::string ¶m)
{
ReadConf();
}
if (c->IsModeSet('P'))
{
int caps = 0;
- const char* i = text.c_str();
- for (; *i; i++)
+ for (std::string::iterator i = text.begin(); i != text.end(); i++)
{
if ( (*i >= 'A') && (*i <= 'Z'))
caps++;