rendered paste bodybool User::ForceNickChange(const char* newnick)
{
int MOD_RESULT = 0;
this->InvalidateCache();
FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(this, newnick));
if (MOD_RESULT)
{
ServerInstance->stats->statsCollisions++;
return false;
}
if (ServerInstance->XLines->MatchesLine("Q",newnick))
{
ServerInstance->stats->statsCollisions++;
return false;
}
std::deque<classbase*> dummy;
Command* nickhandler = ServerInstance->Parser->GetHandler("NICK");
if (nickhandler) // wtfbbq, when would this not be here
{
nickhandler->HandleInternal(1, dummy);
bool result = (ServerInstance->Parser->CallHandler("NICK", &newnick, 1, this) == CMD_SUCCESS);
nickhandler->HandleInternal(0, dummy);
return result;
}
// Unreachable, we hope
return false;
}