public:
CensorUser(InspIRCd* Instance) : ModeHandler(Instance, 'G', 0, 0, false, MODETYPE_USER, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
{
if (adding)
{
public:
CensorChannel(InspIRCd* Instance) : ModeHandler(Instance, 'G', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
{
if (adding)
{
if (target_type == TYPE_USER)
active = ((User*)dest)->IsModeSet('G');
else if (target_type == TYPE_CHANNEL)
+ {
active = ((Channel*)dest)->IsModeSet('G');
+ Channel* c = (Channel*)dest;
+ if (CHANOPS_EXEMPT(ServerInstance, 'G') && c->GetStatus(user) == STATUS_OP)
+ {
+ return 0;
+ }
+ }
if (!active)
return 0;
{
if (index->second.empty())
{
- user->WriteServ("936 %s %s %s :Your message contained a censored word, and was blocked", user->nick, ((Channel*)dest)->name, index->first.c_str());
+ user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked", user->nick, ((Channel*)dest)->name, index->first.c_str());
return 1;
}
virtual Version GetVersion()
{
- return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+ return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
}
};