]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nonotice.cpp
Don't route after nuking the user from orbit, there's no point (minor)
[user/henk/code/inspircd.git] / src / modules / m_nonotice.cpp
index 9de71b366b3bed3e84b9a09bc7070e5485e7cc76..1e88a4cc0ec98b6ad320a1c09bb7f620a3bca763 100644 (file)
 
 /* $ModDesc: Provides support for unreal-style channel mode +T */
 
-class NoNotice : public ModeHandler
+class NoNotice : public SimpleChannelModeHandler
 {
  public:
-       NoNotice(InspIRCd* Instance) : ModeHandler(Instance, 'T', 0, 0, false, MODETYPE_CHANNEL, false) { }
-
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
-       {
-               if (adding)
-               {
-                       if (!channel->IsModeSet('T'))
-                       {
-                               channel->SetMode('T',true);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-               else
-               {
-                       if (channel->IsModeSet('T'))
-                       {
-                               channel->SetMode('T',false);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-
-               return MODEACTION_DENY;
-       }
+       NoNotice(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'T') { }
 };
 
 class ModuleNoNotice : public Module
@@ -96,7 +74,7 @@ class ModuleNoNotice : 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);
        }
 };