- virtual int OnUserPreNick(userrec* user, const std::string &newnick)
+ virtual int OnUserPreNick(User* user, const std::string &newnick)
{
if (isdigit(newnick[0])) /* allow switches to UID */
return 0;
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
{
if (isdigit(newnick[0])) /* allow switches to UID */
return 0;
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
- chanrec *channel = i->first;
+ Channel *channel = i->first;
nickfloodsettings *f;
if (channel->GetExt("nickflood", f))
nickfloodsettings *f;
if (channel->GetExt("nickflood", f))
@@ -236,7+238,7 @@ class ModuleNickFlood : public Module
if (f->islocked())
{
if (f->islocked())
{
- user->WriteServ("447 %s :%s has been locked for nickchanges for 60 seconds because there have been more than %d nick changes in %d seconds", user->nick, channel->name, f->nicks, f->secs);
+ user->WriteNumeric(447, "%s :%s has been locked for nickchanges for 60 seconds because there have been more than %d nick changes in %d seconds", user->nick.c_str(), channel->name.c_str(), f->nicks, f->secs);
return 1;
}
return 1;
}
@@ -245,7+247,7 @@ class ModuleNickFlood : public Module
{
f->clear();
f->lock();
{
f->clear();
f->lock();
- channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name, f->nicks, f->secs);
+ channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name.c_str(), f->nicks, f->secs);
return 1;
}
}
return 1;
}
}
@@ -253,31+255,27 @@ class ModuleNickFlood : public Module