]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added +O mode support through m_operchans.so
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 2 May 2004 16:16:04 +0000 (16:16 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 2 May 2004 16:16:04 +0000 (16:16 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@785 e03df62e-2008-0410-955e-edbf42e46eb7

docs/helpop.conf.example
src/modules/m_operchans.cpp

index d225be23242e6dbf4b0b3a7e48eae1eebe0f12d2..d32dabd90ccf8067f23d248fb9267193ee466d57 100644 (file)
        line13="n                Only users who are members of the channel may message it"
        line14="p                Make channel private (hide from /LIST)"
        line15="s                Make channel secret (can't be used at the same time as +p)"
-       line16="t                Only halfops and above can change the topic">
+       line16="O                Channel is IRCops only (can only be set by IRCops)"
+       line17="t                Only halfops and above can change the topic">
 
index 461b7bece4d7e7f4d3f113221b6e82bd168672d1..ba9a4d79fc4c1784ec51877c33cc057904da8542 100644 (file)
@@ -17,7 +17,7 @@ class ModuleOperChans : public Module
                Srv = new Server;
 
                // Add a mode +O for channels with no parameters                
-               Srv->AddExtendedMode('Z',MT_CHANNEL,false,0,0);
+               Srv->AddExtendedMode('O',MT_CHANNEL,false,0,0);
        }
        
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
@@ -26,7 +26,7 @@ class ModuleOperChans : public Module
                {
                        chanrec* chan = (chanrec*)target;
                        
-                       if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,"")) || (strchr(source->modes,'o')))
+                       if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"")) || (strchr(user->modes,'o')))
                        {
                                return 1;
                        }
@@ -34,7 +34,7 @@ class ModuleOperChans : public Module
                        {
                                // eat the mode change, return an error
                                WriteServ(user->fd,"468 %s %s :Only servers and opers may set channel mode +O",user->nick, chan->name);
-                               return -1;
+                               return 0;
                        }
        
                        // must return 1 to handle the mode!