+ else if (target.type == MessageTarget::TYPE_CHANNEL)
{
{
- active = ((Channel*)dest)->IsModeSet('G');
- Channel* c = (Channel*)dest;
- ModResult res = ServerInstance->OnCheckExemption(user,c,"censor");
+ Channel* c = target.Get<Channel>();
+ active = c->IsModeSet(cc);
+ ModResult res = CheckExemption::Call(exemptionprov, user, c, "censor");
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
@@ -89,30+63,25 @@ class ModuleCensor : public Module
if (!active)
return MOD_RES_PASSTHRU;
if (!active)
return MOD_RES_PASSTHRU;
- irc::string text2 = text.c_str();
for (censor_t::iterator index = censors.begin(); index != censors.end(); index++)
{
for (censor_t::iterator index = censors.begin(); index != censors.end(); index++)
{
- if (text2.find(index->first) != irc::string::npos)
+ size_t censorpos;
+ while ((censorpos = irc::find(details.text, index->first)) != std::string::npos)
{
if (index->second.empty())
{
{
if (index->second.empty())
{
- user->WriteNumeric(ERR_WORDFILTERED, "%s %s %s :Your message contained a censored word, and was blocked", user->nick.c_str(), ((Channel*)dest)->name.c_str(), index->first.c_str());