]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nonotice.cpp
Remote /MAP (that now doesn't confuse clients ;p)
[user/henk/code/inspircd.git] / src / modules / m_nonotice.cpp
index 11b57e09be9d2530f320750f0231dfb3c4b89b61..52ddb537dbe60958ea861514407bb143787a1fd7 100644 (file)
@@ -20,7 +20,7 @@ class NoNotice : public ModeHandler
  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)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                if (adding)
                {
@@ -68,14 +68,19 @@ class ModuleNoNotice : public Module
                        Channel* c = (Channel*)dest;
                        if (c->IsModeSet('T'))
                        {
-                               if ((ServerInstance->ULine(user->server)) || (c->GetStatus(user) == STATUS_OP) || (c->GetStatus(user) == STATUS_HOP))
+                               if (ServerInstance->ULine(user->server))
                                {
-                                       // ops and halfops can still /NOTICE the channel
+                                       // ulines are exempt.
+                                       return 0;
+                               }
+                               else if (CHANOPS_EXEMPT(ServerInstance, 'T') && c->GetStatus(user) == STATUS_OP)
+                               {
+                                       // channel ops are exempt if set in conf.
                                        return 0;
                                }
                                else
                                {
-                                       user->WriteServ("404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
+                                       user->WriteNumeric(404, "%s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
                                        return 1;
                                }
                        }
@@ -91,7 +96,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);
        }
 };