if (c->IsModeSet('M') && !is_registered && res != MOD_RES_ALLOW)
{
// user messaging a +M channel and is not registered
- user->WriteNumeric(477, ""+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
+ user->WriteNumeric(477, user->nick+" "+c->name+" :You need to be identified to a registered account to message this channel");
return MOD_RES_DENY;
}
}
ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask)
{
- if (mask[1] == ':')
+ static bool checking = false;
+ if (checking)
+ return MOD_RES_PASSTHRU;
+
+ if ((mask.length() > 2) && (mask[1] == ':'))
{
if (mask[0] == 'R')
{
/* If we made it this far we know the user isn't registered
so just deny if it matches */
- if (chan->GetExtBanStatus(user, 'U') == MOD_RES_DENY)
+ checking = true;
+ bool result = chan->CheckBan(user, mask.substr(2));
+ checking = false;
+
+ if (result)
return MOD_RES_DENY;
}
}