#include "inspircd.h"
-/* $ModDesc: Provides channel mode +c to block color */
-
/** Handles the +c channel mode
*/
class BlockColor : public SimpleChannelModeHandler
{
}
- void init() CXX11_OVERRIDE
- {
- ServerInstance->Modules->AddService(bc);
- Implementation eventlist[] = { I_OnUserPreMessage, I_On005Numeric };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
- }
-
void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
tokens["EXTBAN"].push_back('c');
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
- if (!c->GetExtBanStatus(user, 'c').check(!c->IsModeSet('c')))
+ if (!c->GetExtBanStatus(user, 'c').check(!c->IsModeSet(bc)))
{
for (std::string::iterator i = text.begin(); i != text.end(); i++)
{
case 21:
case 22:
case 31:
- user->WriteNumeric(404, "%s %s :Can't send colors to channel (+c set)",user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s :Can't send colors to channel (+c set)", c->name.c_str());
return MOD_RES_DENY;
break;
}