]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Renamed to chanrec::modes
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 12 Mar 2006 14:49:30 +0000 (14:49 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 12 Mar 2006 14:49:30 +0000 (14:49 +0000)
Renamed IsCustomModeSet to IsModeSet
GetModeParameter will now return the channel limit (as a string) for a request for mode 'l' and the channel key for a request for mode 'k'.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3692 e03df62e-2008-0410-955e-edbf42e46eb7

29 files changed:
include/channels.h
src/channels.cpp
src/cmd_invite.cpp
src/cmd_list.cpp
src/cmd_names.cpp
src/cmd_notice.cpp
src/cmd_privmsg.cpp
src/cmd_topic.cpp
src/message.cpp
src/mode.cpp
src/modules/m_blockcaps.cpp
src/modules/m_blockcolor.cpp
src/modules/m_censor.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_knock.cpp
src/modules/m_noctcp.cpp
src/modules/m_noinvite.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_operchans.cpp
src/modules/m_override.cpp
src/modules/m_redirect.cpp
src/modules/m_safelist.cpp
src/modules/m_services.cpp
src/modules/m_sslmodes.cpp
src/modules/m_stripcolor.cpp
src/modules/m_testcommand.cpp
src/modules/m_uninvite.cpp

index 4c430af32afd8392a420d8bbb7f6b8d8b0f7ba8f..65f3948fe7d742b1c2c12643f4d0fee75cc7532d 100644 (file)
@@ -111,7 +111,7 @@ class chanrec : public Extensible
        /** Custom modes for the channel.
         * Plugins may use this field in any way they see fit.
         */
-       char custom_modes[64];     /* modes handled by modules */
+       char modes[64];     /* modes handled by modules */
 
        /** User lists
         * There are four user lists, one for 
@@ -174,11 +174,11 @@ class chanrec : public Extensible
         */
        void SetCustomModeParam(char mode,char* parameter,bool mode_on);
  
-       /** Returns true if a custom mode is set on a channel
+       /** Returns true if a mode is set on a channel
          * @param mode The mode character you wish to query
          * @return True if the custom mode is set, false if otherwise
          */
-       bool IsCustomModeSet(char mode);
+       bool IsModeSet(char mode);
 
        /** Returns the parameter for a custom mode on a channel.
          * @param mode The mode character you wish to query
index aabf9664c582b88f3f8fe4120eb44a8a3575fd36..3f2eca3f5f85ff33e12594c9ff5667e94dec9a15 100644 (file)
@@ -73,12 +73,12 @@ chanrec::chanrec()
        *name = *topic = *setby = *key = 0;
        created = topicset = limit = 0;
        internal_userlist.clear();
-       memset(&custom_modes,0,64);
+       memset(&modes,0,64);
 }
 
 void chanrec::SetCustomMode(char mode,bool mode_on)
 {
-       custom_modes[mode-65] = mode_on;
+       modes[mode-65] = mode_on;
        if (!mode_on)
                this->SetCustomModeParam(mode,"",false);
 }
@@ -108,19 +108,30 @@ void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
        }
 }
 
-bool chanrec::IsCustomModeSet(char mode)
+bool chanrec::IsModeSet(char mode)
 {
-       return custom_modes[mode-65];
+       return modes[mode-65];
 }
 
 std::string chanrec::GetModeParameter(char mode)
 {
-       std::map<char,char*>::iterator n = custom_mode_params.find(mode);
-       if (n != custom_mode_params.end())
+       if (mode == 'k')
        {
-               return n->second;
+               return this->key;
+       }
+       else if (mode == 'l')
+       {
+               return ConvToStr(this->limit);
+       }
+       else
+       {
+               std::map<char,char*>::iterator n = custom_mode_params.find(mode);
+               if (n != custom_mode_params.end())
+               {
+                       return n->second;
+               }
+               return "";
        }
-       return "";
 }
 
 long chanrec::GetUserCounter()
@@ -254,7 +265,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                /* create a new one */
                chanlist[cname] = new chanrec();
                strlcpy(chanlist[cname]->name, cname,CHANMAX);
-               chanlist[cname]->custom_modes[CM_TOPICLOCK] = chanlist[cname]->custom_modes[CM_NOEXTERNAL] = 1;
+               chanlist[cname]->modes[CM_TOPICLOCK] = chanlist[cname]->modes[CM_NOEXTERNAL] = 1;
                //chanlist[cname]->binarymodes = CM_TOPICLOCK | CM_NOEXTERNAL;
                chanlist[cname]->created = TIME;
                *chanlist[cname]->topic = 0;
@@ -312,7 +323,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                                                }
                                        }
                                }
-                               if (Ptr->custom_modes[CM_INVITEONLY])
+                               if (Ptr->modes[CM_INVITEONLY])
                                {
                                        MOD_RESULT = 0;
                                        irc::string xname(Ptr->name);
index 3dbabe85946fd417c85fab4ee7496dad3e88c08d..33e61189d0091ac115a6cf8d3a8fec8922176f37 100644 (file)
@@ -64,7 +64,7 @@ void cmd_invite::Handle (char **parameters, int pcnt, userrec *user)
                        return;
                }
 
-               if ((c->custom_modes[CM_INVITEONLY]) && (IS_LOCAL(user)))
+               if ((c->modes[CM_INVITEONLY]) && (IS_LOCAL(user)))
                {
                        if (cstatus(user,c) < STATUS_HOP)
                        {
index 3b91d88e9c7f2a4410f5881d7b0b13c5840c6746..27a9ce44d5bc3f0e81ea1e44a07563589a33da69 100644 (file)
@@ -47,7 +47,7 @@ void cmd_list::Handle (char **parameters, int pcnt, userrec *user)
        {
                // if the channel is not private/secret, OR the user is on the channel anyway
                bool n = i->second->HasUser(user);
-               if (((!(i->second->custom_modes[CM_PRIVATE])) && (!(i->second->custom_modes[CM_SECRET]))) || (n))
+               if (((!(i->second->modes[CM_PRIVATE])) && (!(i->second->modes[CM_SECRET]))) || (n))
                {
                        long users = usercount_i(i->second);
                        if (users)
index 2eb046eac33eb0f46d2f4066e9a6c88b4f60a765..e5e83a70ffac5d9fc0fcf8496ad52d75e3aa74ba 100644 (file)
@@ -76,7 +76,7 @@ void cmd_names::Handle (char **parameters, int pcnt, userrec *user)
        c = FindChan(parameters[0]);
        if (c)
        {
-               if ((c->custom_modes[CM_SECRET]) && (!c->HasUser(user)))
+               if ((c->modes[CM_SECRET]) && (!c->HasUser(user)))
                 {
                       WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, c->name);
                       return;
index 6e894e6a45b1a6ca18a2735c5019d889cf134d2d..1adb43923004829673ea243f73ed19f6cc434ea6 100644 (file)
@@ -94,12 +94,12 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                {
                        if (IS_LOCAL(user))
                        {
-                               if ((chan->custom_modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
+                               if ((chan->modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
                                        return;
                                }
-                               if ((chan->custom_modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
+                               if ((chan->modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
                                        return;
index feed752930fc0dd3c53b92683e9ba02e92e165ff..f5adf14d0fceb8f5295ba344a0a951bf01075ed7 100644 (file)
@@ -94,12 +94,12 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user)
                {
                        if (IS_LOCAL(user))
                        {
-                               if ((chan->custom_modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
+                               if ((chan->modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
                                        return;
                                }
-                               if ((chan->custom_modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
+                               if ((chan->modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
                                        return;
index 37cfe035e874be03a65a87c0e7c68d4c721998d0..b8c60240dc5ade2abe2a1ee55c2f8e4438209e33 100644 (file)
@@ -70,7 +70,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
                Ptr = FindChan(parameters[0]);
                if (Ptr)
                {
-                       if ((Ptr->custom_modes[CM_SECRET]) && (!Ptr->HasUser(user)))
+                       if ((Ptr->modes[CM_SECRET]) && (!Ptr->HasUser(user)))
                        {
                                WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, Ptr->name);
                                return;
@@ -103,7 +103,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
                                        WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, Ptr->name);
                                        return;
                                }
-                               if ((Ptr->custom_modes[CM_TOPICLOCK]) && (cstatus(user,Ptr)<STATUS_HOP))
+                               if ((Ptr->modes[CM_TOPICLOCK]) && (cstatus(user,Ptr)<STATUS_HOP))
                                {
                                        WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name);
                                        return;
index 87e23e5015cbbf7a94184b069d2d800e6762e08d..0a41e5b8a6d0943dbb44f7feab7ec369f861f8a0 100644 (file)
@@ -416,7 +416,7 @@ std::string chlist(userrec *user,userrec* source)
                        {
                                // if the channel is NOT private/secret, OR the source user is on the channel, AND the user is not invisible.
                                // if the user is the same as the source, shortcircuit the comparison.
-                               if ((source == user) || ((((!(((ucrec*)(*i))->channel->custom_modes[CM_PRIVATE])) && (!(((ucrec*)(*i))->channel->custom_modes[CM_SECRET])) && (!userinvisible)) || (((ucrec*)(*i))->channel->HasUser(source)))))
+                               if ((source == user) || ((((!(((ucrec*)(*i))->channel->modes[CM_PRIVATE])) && (!(((ucrec*)(*i))->channel->modes[CM_SECRET])) && (!userinvisible)) || (((ucrec*)(*i))->channel->HasUser(source)))))
                                {
                                        lst = lst + std::string(cmode(user,((ucrec*)(*i))->channel)) + std::string(((ucrec*)(*i))->channel->name) + " ";
                                }
index fa3ccd88d1ced5bf59cf5cd174dfbb1f6dea541e..5d93eb161afa8c22ffb5f6e8374538124f5808a7 100644 (file)
@@ -653,7 +653,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                                break;
                                        previously_set_k = true;
                                                
-                                       if (!chan->custom_modes[CM_KEY])
+                                       if (!chan->modes[CM_KEY])
                                        {
                                                MOD_RESULT = 0;
                                                FOREACH_RESULT(I_OnRawMode,OnRawMode(user, chan, 'k', parameters[param], true, 1));
@@ -664,7 +664,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                                        strlcpy(key,parameters[param++],32);
                                                        outpars[pc++] = key;
                                                        strlcpy(chan->key,key,MAXBUF);
-                                                       chan->custom_modes[CM_KEY] = 1;
+                                                       chan->modes[CM_KEY] = 1;
                                                        k_set = true;
                                                }
                                                else param++;
@@ -689,7 +689,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                                {
                                                        *outl++ = 'k';
                                                        *chan->key = 0;
-                                                       chan->custom_modes[CM_KEY] = 0;
+                                                       chan->modes[CM_KEY] = 0;
                                                        outpars[pc++] = key;
                                                }
                                        }
@@ -707,11 +707,11 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                         FOREACH_RESULT(I_OnRawMode,OnRawMode(user, chan, 'l', "", false, 0));
                                         if (!MOD_RESULT)
                                         {
-                                               if (chan->custom_modes[CM_LIMIT])
+                                               if (chan->modes[CM_LIMIT])
                                                {
                                                        *outl++ = 'l';
                                                        chan->limit = 0;
-                                                       chan->custom_modes[CM_LIMIT] = 0;
+                                                       chan->modes[CM_LIMIT] = 0;
                                                }
                                        }
                                }
@@ -756,7 +756,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                        if (chan->limit)
                                        {
                                                *outl++ = 'l';
-                                               chan->custom_modes[CM_LIMIT] = 1;
+                                               chan->modes[CM_LIMIT] = 1;
                                                outpars[pc++] = parameters[param++];
                                                l_set = true;
                                        }
@@ -770,13 +770,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                 {
                                        if (mdir)
                                        {
-                                               if (!(chan->custom_modes[CM_INVITEONLY])) *outl++ = 'i';
-                                               chan->custom_modes[CM_INVITEONLY] = 1;
+                                               if (!(chan->modes[CM_INVITEONLY])) *outl++ = 'i';
+                                               chan->modes[CM_INVITEONLY] = 1;
                                        }
                                        else
                                        {
-                                               if (chan->custom_modes[CM_INVITEONLY]) *outl++ = 'i';
-                                               chan->custom_modes[CM_INVITEONLY] = 0;
+                                               if (chan->modes[CM_INVITEONLY]) *outl++ = 'i';
+                                               chan->modes[CM_INVITEONLY] = 0;
                                        }
                                }
                        break;
@@ -788,13 +788,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                 {
                                        if (mdir)
                                         {
-                                               if (!(chan->custom_modes[CM_TOPICLOCK])) *outl++ = 't';
-                                                chan->custom_modes[CM_TOPICLOCK] = 1;
+                                               if (!(chan->modes[CM_TOPICLOCK])) *outl++ = 't';
+                                                chan->modes[CM_TOPICLOCK] = 1;
                                         }
                                         else
                                         {
-                                               if (chan->custom_modes[CM_TOPICLOCK]) *outl++ = 't';
-                                                chan->custom_modes[CM_TOPICLOCK] = 0;
+                                               if (chan->modes[CM_TOPICLOCK]) *outl++ = 't';
+                                                chan->modes[CM_TOPICLOCK] = 0;
                                         }
                                }
                        break;
@@ -806,13 +806,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                 {
                                         if (mdir)
                                         {
-                                               if (!(chan->custom_modes[CM_NOEXTERNAL])) *outl++ = 'n';
-                                                chan->custom_modes[CM_NOEXTERNAL] = 1;
+                                               if (!(chan->modes[CM_NOEXTERNAL])) *outl++ = 'n';
+                                                chan->modes[CM_NOEXTERNAL] = 1;
                                         }
                                         else
                                         {
-                                               if (chan->custom_modes[CM_NOEXTERNAL]) *outl++ = 'n';
-                                                chan->custom_modes[CM_NOEXTERNAL] = 0;
+                                               if (chan->modes[CM_NOEXTERNAL]) *outl++ = 'n';
+                                                chan->modes[CM_NOEXTERNAL] = 0;
                                         }
                                }
                        break;
@@ -824,13 +824,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                 {
                                         if (mdir)
                                         {
-                                                if (!(chan->custom_modes[CM_MODERATED])) *outl++ = 'm';
-                                                chan->custom_modes[CM_MODERATED] = 1;
+                                                if (!(chan->modes[CM_MODERATED])) *outl++ = 'm';
+                                                chan->modes[CM_MODERATED] = 1;
                                         }
                                         else
                                         {
-                                                if (chan->custom_modes[CM_MODERATED]) *outl++ = 'm';
-                                                chan->custom_modes[CM_MODERATED] = 0;
+                                                if (chan->modes[CM_MODERATED]) *outl++ = 'm';
+                                                chan->modes[CM_MODERATED] = 0;
                                         }
                                }
                        break;
@@ -842,11 +842,11 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                 {
                                         if (mdir)
                                         {
-                                                if (!(chan->custom_modes[CM_SECRET])) *outl++ = 's';
-                                                chan->custom_modes[CM_SECRET] = 1;
-                                                if (chan->custom_modes[CM_PRIVATE])
+                                                if (!(chan->modes[CM_SECRET])) *outl++ = 's';
+                                                chan->modes[CM_SECRET] = 1;
+                                                if (chan->modes[CM_PRIVATE])
                                                 {
-                                                        chan->custom_modes[CM_PRIVATE] = 0;
+                                                        chan->modes[CM_PRIVATE] = 0;
                                                         if (mdir)
                                                         {
                                                                *outl++ = '-'; *outl++ = 'p'; *outl++ = '+';
@@ -855,8 +855,8 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                         }
                                         else
                                         {
-                                                if (chan->custom_modes[CM_SECRET]) *outl++ = 's';
-                                                chan->custom_modes[CM_SECRET] = 0;
+                                                if (chan->modes[CM_SECRET]) *outl++ = 's';
+                                                chan->modes[CM_SECRET] = 0;
                                         }
                                }
                        break;
@@ -868,14 +868,14 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                {
                                        if(mdir)
                                        {
-                                               if(!(chan->custom_modes[CM_PRIVATE]))
+                                               if(!(chan->modes[CM_PRIVATE]))
                                                        *outl++ = 'p';
                                                
-                                               chan->custom_modes[CM_PRIVATE] = 1;
+                                               chan->modes[CM_PRIVATE] = 1;
                                                
-                                               if(chan->custom_modes[CM_SECRET])
+                                               if(chan->modes[CM_SECRET])
                                                {
-                                                       chan->custom_modes[CM_SECRET] = 0;
+                                                       chan->modes[CM_SECRET] = 0;
 
                                                        *outl++ = '-';
                                                        *outl++ = 's';
@@ -884,10 +884,10 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                                        }
                                        else
                                        {
-                                               if(chan->custom_modes[CM_PRIVATE])
+                                               if(chan->modes[CM_PRIVATE])
                                                        *outl++ = 'p';
                                                
-                                               chan->custom_modes[CM_PRIVATE] = 0;
+                                               chan->modes[CM_PRIVATE] = 0;
                                        }
                                }
                                break;
@@ -895,7 +895,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
                        default:
                                string_list p;
                                p.clear();
-                               bool x = chan->custom_modes[*modechar-65];
+                               bool x = chan->modes[*modechar-65];
                                if ((!x && !mdir) || (x && mdir))
                                {
                                        if (!ModeIsListMode(*modechar,MT_CHANNEL))
index f7ee81fd5ed7b10632e7abca56014de6f5489bb7..3db5e1ba8fa4d152659b455ed13d916cc49ffa90 100644 (file)
@@ -49,7 +49,7 @@ public:
                {
                        chanrec* c = (chanrec*)dest;
 
-                       if (c->IsCustomModeSet('P'))
+                       if (c->IsModeSet('P'))
                        {
                                char* i = (char*)text.c_str();
                                for (; *i; i++)
index de782cf1922db5e419a81e2e4efb4d26cce81152..8389984d8382b454bb5ff85f81b53bec6d831488 100644 (file)
@@ -52,7 +52,7 @@ class ModuleBlockColour : public Module
                {
                        chanrec* c = (chanrec*)dest;
                        
-                       if(c->IsCustomModeSet('c'))
+                       if(c->IsModeSet('c'))
                        {
                                /* Replace a strlcpy(), which ran even when +c wasn't set, with this (no copies at all) -- Om */
                                for(unsigned int i = 0; i < text.length(); i++)
index e57d09c8cc4fcbb7355aff7b846a2ad866aa6ba3..03b4f0f9dfc8d2726dac90b43000468050921238 100644 (file)
@@ -124,7 +124,7 @@ class ModuleCensor : public Module
                                else if (target_type == TYPE_CHANNEL)
                                {
                                        chanrec* t = (chanrec*)dest;
-                                       active = (t->IsCustomModeSet('G'));
+                                       active = (t->IsModeSet('G'));
                                }
                                
                                if (active)
index 01373019c1b0db832f28f60664e2b8ca638d4e3c..18fd995ad201ad6870eedbf0eec5315c74f49861 100644 (file)
@@ -105,7 +105,7 @@ public:
        
        virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason)
        {
-               if (chan->IsCustomModeSet('J') && (source != user))
+               if (chan->IsModeSet('J') && (source != user))
                {
                        delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
                        
index 2e63e890b1ca4ad5b42a5aaef87794ae87c63d9f..9169cfd4cb0a93391b55f94651ec37da166fd0b0 100644 (file)
@@ -40,7 +40,7 @@ class cmd_knock : public command_t
                chanrec* c = Srv->FindChannel(parameters[0]);
                std::string line = "";
 
-               if (c->IsCustomModeSet('K'))
+               if (c->IsModeSet('K'))
                {
                        WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
                        return;
@@ -52,7 +52,7 @@ class cmd_knock : public command_t
                }
                line = line + std::string(parameters[pcnt-1]);
 
-               if (c->custom_modes[CM_INVITEONLY])
+               if (c->modes[CM_INVITEONLY])
                {
                        WriteChannelWithServ((char*)Srv->GetServerName().c_str(),c,"NOTICE %s :User %s is KNOCKing on %s (%s)",c->name,user->nick,c->name,line.c_str());
                        WriteServ(user->fd,"NOTICE %s :KNOCKing on %s",user->nick,c->name);
index ab0808aa23b6749b88d4ce34db179bdd325d603d..42d2330025eedb4848ac91509ea4fd614948e719 100644 (file)
@@ -57,7 +57,7 @@ class ModuleNoCTCP : public Module
                if (target_type == TYPE_CHANNEL)
                {
                        chanrec* c = (chanrec*)dest;
-                       if (c->IsCustomModeSet('C'))
+                       if (c->IsModeSet('C'))
                        {
                                if ((text.length()) && (text[0] == '\1'))
                                {
index 1d4d8fedd03211d75ee5d858299639d43f03544c..a0caade2a23e3df719f4ceb649edfbc555c21077 100644 (file)
@@ -50,7 +50,7 @@ class ModuleNoInvite : public Module
 
                virtual int OnUserPreInvite(userrec* user,userrec* dest,chanrec* channel)
                {
-                       if (channel->IsCustomModeSet('V'))
+                       if (channel->IsModeSet('V'))
                        {
                                WriteServ(user->fd,"492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
                                return 1;
index d5b99b388990b2cf682f60d21b631c2d386ba1f3..be16da60876b03a3226b833c277a06ec453ed969 100644 (file)
@@ -51,7 +51,7 @@ class ModuleNoKicks : public Module
        {
                if (access_type == AC_KICK)
                {
-                       if (channel->IsCustomModeSet('Q'))
+                       if (channel->IsModeSet('Q'))
                        {
                                if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,"")))
                                {
index 94e0fe4b99eb4635a3566a3dad18ecde2e13736f..78d10db3372bd647cea2ea8d6995744be22056fa 100644 (file)
@@ -69,7 +69,7 @@ class ModuleNoNickChange : public Module
                                if (((ucrec*)(*i))->channel != NULL)
                                {
                                        chanrec* curr = ((ucrec*)(*i))->channel;
-                                       if ((curr->IsCustomModeSet('N')) && (!*user->oper))
+                                       if ((curr->IsModeSet('N')) && (!*user->oper))
                                        {
                                                // don't allow the nickchange, theyre on at least one channel with +N set
                                                // and theyre not an oper
index 01c849e5596895dd1bd692933f34b1c7c9747cee..1e977d355a1da129c0d0e8aa3d7334ff05e1500d 100644 (file)
@@ -46,7 +46,7 @@ class ModuleNoNotice : public Module
                if (target_type == TYPE_CHANNEL)
                {
                        chanrec* c = (chanrec*)dest;
-                       if (c->IsCustomModeSet('T'))
+                       if (c->IsModeSet('T'))
                        {
                                if ((Srv->IsUlined(user->server)) || (Srv->ChanMode(user,c) == "@") || (Srv->ChanMode(user,c) == "%"))
                                {
index 21e360b1da6e80a8f9a9bf2e0a965045017d5e07..7ff66bdb289b0598184d1c751e60b5df8b476604 100644 (file)
@@ -77,7 +77,7 @@ class ModuleOperChans : public Module
                {
                        if (chan)
                        {
-                               if (chan->IsCustomModeSet('O'))
+                               if (chan->IsModeSet('O'))
                                {
                                        WriteServ(user->fd,"520 %s %s :Only IRC operators may join the channel %s (+O is set)",user->nick, chan->name,chan->name);
                                        return 1;
index b048f74936f5017d0d75444af5bec613fee05252..f92bb9899b8970209e747ec715fa07bd3953946e 100644 (file)
@@ -185,7 +185,7 @@ class ModuleOverride : public Module
                {
                        if (chan)
                        {
-                               if ((chan->custom_modes[CM_INVITEONLY]) && (CanOverride(user,"INVITE")))
+                               if ((chan->modes[CM_INVITEONLY]) && (CanOverride(user,"INVITE")))
                                {
                                        if (NoisyOverride)
                                        {
index a91ddef7f6104d0d00424a8e1add07f2cfd956bf..799eb25deecb3f8ca906eb0ba5fae1ab51f0875c 100644 (file)
@@ -57,7 +57,7 @@ class ModuleRedirect : public Module
                                if (c)
                                {
                                        /* Fix by brain: Dont let a channel be linked to *itself* either */
-                                       if ((c == target) || (c->IsCustomModeSet('L')))
+                                       if ((c == target) || (c->IsModeSet('L')))
                                        {
                                                WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str());
                                                return 0;
@@ -83,7 +83,7 @@ class ModuleRedirect : public Module
        {
                if (chan)
                {
-                       if (chan->IsCustomModeSet('L'))
+                       if (chan->IsModeSet('L'))
                        {
                                if (Srv->CountUsers(chan) >= chan->limit)
                                {
index 90eb0d613b9055ca6bd60e6e9f36bbf22bf3f569..fb5513fe25ca2cde1c73e06d9d06345d6c37049d 100644 (file)
@@ -98,7 +98,7 @@ class ListTimer : public InspTimer
                                         chan = Srv->GetChannelIndex(ld->list_position);
                                         /* spool details */
                                        bool has_user = (chan && chan->HasUser(u));
-                                        if ((chan) && (((!(chan->custom_modes[CM_PRIVATE])) && (!(chan->custom_modes[CM_SECRET]))) || (has_user)))
+                                        if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user)))
                                         {
                                                 /* Increment total plus linefeed */
                                                long users = usercount_i(chan);
index ead96ae98d11e46ea47f8e60f8006527e2497392..4d51838412d6b4192a5a083b338108788129c273 100644 (file)
@@ -133,7 +133,7 @@ class ModuleServices : public Module
                if (target_type == TYPE_CHANNEL)
                {
                        chanrec* c = (chanrec*)dest;
-                       if ((c->IsCustomModeSet('M')) && (!strchr(user->modes,'r')))
+                       if ((c->IsModeSet('M')) && (!strchr(user->modes,'r')))
                        {
                                if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"")))
                                {
@@ -172,7 +172,7 @@ class ModuleServices : public Module
        {
                if (chan)
                {
-                       if (chan->IsCustomModeSet('R'))
+                       if (chan->IsModeSet('R'))
                        {
                                if (!strchr(user->modes,'r'))
                                {
index 3ed40108dac71fcdddcb2aa4e6f6bc11766416a1..ed9d556716f7a789ee7b0bbd8f5dc61fda2af531 100644 (file)
@@ -29,7 +29,7 @@ class ModuleSSLModes : public Module
        
        virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
        {
-               if(chan && chan->IsCustomModeSet('z'))
+               if(chan && chan->IsModeSet('z'))
                {
                        if(user->GetExt("ssl"))
                        {
index 19c69ec4b5ea39e00e492ca0df8193da3e5d2807..22b1cf7e8d1646f2bfb8947edcf6d223c3025f4e 100644 (file)
@@ -133,7 +133,7 @@ class ModuleStripColor : public Module
                else if (target_type == TYPE_CHANNEL)
                {
                        chanrec* t = (chanrec*)dest;
-                       active = (t->IsCustomModeSet('S'));
+                       active = (t->IsModeSet('S'));
                }
                if (active)
                {
index ccb5bde6d1efc19dec665de2bdd0ac97d85f5dc8..ceb0651d8b03de572b1570b33a9854658998a7bb 100644 (file)
@@ -109,7 +109,7 @@ class ModuleTestCommand : public Module
        virtual void OnUserJoin(userrec* user, chanrec* channel)
        {
                Srv->Log(DEBUG,"OnUserJoin triggered");
-               if (channel->IsCustomModeSet('Z'))
+               if (channel->IsModeSet('Z'))
                {
                        std::string param = channel->GetModeParameter('Z');
                        Srv->Log(DEBUG,"Custom mode is set on this channel! Parameter="+param);
index 07c01f058c1d24f630bfddd59c323d5498b94673..07e975392ce175148cb1817b30b511acfedb57eb 100644 (file)
@@ -54,7 +54,7 @@ class cmd_uninvite : public command_t
                         return; 
                 }        
 
-                if (c->custom_modes[CM_INVITEONLY])
+                if (c->modes[CM_INVITEONLY])
                 {
                         if (cstatus(user,c) < STATUS_HOP)
                         {