X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_censor.cpp;h=b4746d93660beeb2e6583c38b9f4a406cdaa82a8;hb=89fc6ca9c66198fe54cce19d59279cd454fc1bd0;hp=8b8c5cb5e087ee6984257cd85903d0b82b69aa8e;hpb=6e053a9ff6b387e8bfd97e6252a354e62e4281ca;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 8b8c5cb5e..b4746d936 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -27,7 +27,7 @@ class CensorUser : public ModeHandler 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) { @@ -57,7 +57,7 @@ class CensorChannel : public ModeHandler 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) { @@ -140,7 +140,14 @@ class ModuleCensor : public Module 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; @@ -152,7 +159,7 @@ class ModuleCensor : public Module { 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; } @@ -189,7 +196,7 @@ class ModuleCensor : public Module 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); } };