]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noctcp.cpp
Merge pull request #215 from attilamolnar/insp20+modfixes
[user/henk/code/inspircd.git] / src / modules / m_noctcp.cpp
index 5dfbf76d2babcd20692acaec38c5e84fe3e15c9b..0b4e39764151486e9b12d9a1318cd2abd5689a66 100644 (file)
@@ -1,16 +1,24 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2004, 2006 Craig Edwards <craigedwards@brainbox.cc>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +C */
@@ -65,7 +73,7 @@ class ModuleNoCTCP : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Provides support for unreal-style channel mode +C", VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("Provides support for unreal-style channel mode +C", VF_VENDOR);
        }
 
        virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
@@ -78,11 +86,10 @@ class ModuleNoCTCP : public Module
                if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
                {
                        Channel* c = (Channel*)dest;
+                       ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp");
 
-                       if (CHANOPS_EXEMPT('C') && c->GetPrefixValue(user) == OP_VALUE)
-                       {
+                       if (res == MOD_RES_ALLOW)
                                return MOD_RES_PASSTHRU;
-                       }
 
                        if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet('C')))
                        {