X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_noctcp.cpp;h=e68cf72a0971474628173677a4d2d054867c00af;hb=89fc6ca9c66198fe54cce19d59279cd454fc1bd0;hp=2ae9505e1df73f65406b3e4fa6a7723f076b226f;hpb=ece985ccb3210a132d67381511642edfb359f5c4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 2ae9505e1..e68cf72a0 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -20,7 +20,7 @@ class NoCTCP : public ModeHandler public: NoCTCP(InspIRCd* Instance) : ModeHandler(Instance, 'C', 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) { @@ -72,13 +72,19 @@ class ModuleNoCTCP : public Module if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { Channel* c = (Channel*)dest; + + if (CHANOPS_EXEMPT(ServerInstance, 'C') && c->GetStatus(user) == STATUS_OP) + { + return 0; + } + if (c->IsModeSet('C')) { if ((text.length()) && (text[0] == '\1')) { if (strncmp(text.c_str(),"\1ACTION ",8)) { - user->WriteServ("492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name); + user->WriteNumeric(492, "%s %s :Can't send CTCP to channel (+C set)",user->nick, c->name); return 1; } } @@ -95,7 +101,7 @@ class ModuleNoCTCP : 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); } };