]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change m_redirect, m_joinflood and m_messageflood to put their modes in the correct...
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 25 Jan 2006 20:31:33 +0000 (20:31 +0000)
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 25 Jan 2006 20:31:33 +0000 (20:31 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2898 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_joinflood.cpp
src/modules/m_messageflood.cpp
src/modules/m_redirect.cpp

index a15c48bc9662e1491bffb304bd7defa40a5e1b00..ca19bf14ad19cf1c6a6a14eadd4b852f846ae8ee 100644 (file)
@@ -221,25 +221,10 @@ class ModuleJoinFlood : public Module
                List[I_On005Numeric] = List[I_OnExtendedMode] = List[I_OnChannelDelete] = List[I_OnUserPreJoin] = List[I_OnUserJoin] = 1;
        }
 
-        virtual void On005Numeric(std::string &output)
-        {
-                std::stringstream line(output);
-                std::string temp1, temp2;
-                while (!line.eof())
-                {
-                        line >> temp1;
-                        if (temp1.substr(0,10) == "CHANMODES=")
-                        {
-                               // By doing this we're *assuming* no other module has fucked up the CHANMODES=
-                               // section of the 005 numeric. If they have, we're going DOWN in a blaze of glory,
-                               // with a honking great EXCEPTION :)
-                               temp1.insert(temp1.find(",")+1,"j");
-                        }
-                        temp2 = temp2 + temp1 + " ";
-                }
-               if (temp2.length())
-                       output = temp2.substr(0,temp2.length()-1);
-        }
+       virtual void On005Numeric(std::string &output)
+       {
+               InsertMode(output, "j", 3);
+       }
 
        virtual ~ModuleJoinFlood()
        {
index 9e2f2a0301bb3ab1812c869ab9c821707cd0f04a..f2c55d584608ac825df9c66b8819a91f425434ee 100644 (file)
@@ -226,25 +226,10 @@ class ModuleMsgFlood : public Module
                List[I_On005Numeric] = List[I_OnExtendedMode] = List[I_OnChannelDelete] = List[I_OnUserNotice] = List[I_OnUserMessage] = 1;
        }
 
-        virtual void On005Numeric(std::string &output)
-        {
-                std::stringstream line(output);
-                std::string temp1, temp2;
-                while (!line.eof())
-                {
-                        line >> temp1;
-                        if (temp1.substr(0,10) == "CHANMODES=")
-                        {
-                               // By doing this we're *assuming* no other module has fucked up the CHANMODES=
-                               // section of the 005 numeric. If they have, we're going DOWN in a blaze of glory,
-                               // with a honking great EXCEPTION :)
-                               temp1.insert(temp1.find(",")+1,"f");
-                        }
-                        temp2 = temp2 + temp1 + " ";
-                }
-               if (temp2.length())
-                       output = temp2.substr(0,temp2.length()-1);
-        }
+       virtual void On005Numeric(std::string &output)
+       {
+               InsertMode(output, "f", 3);
+       }
 
        virtual ~ModuleMsgFlood()
        {
index bedb900777f6a7e7199a7601f352b0930064d372..a7115a15e35f4931757ba8949c0c796864429375 100644 (file)
@@ -66,25 +66,10 @@ class ModuleRedirect : public Module
                List[I_On005Numeric] = List[I_OnUserPreJoin] = List[I_OnExtendedMode] = 1;
        }
 
-        virtual void On005Numeric(std::string &output)
-        {
-                std::stringstream line(output);
-                std::string temp1, temp2;
-                while (!line.eof())
-                {
-                        line >> temp1;
-                        if (temp1.substr(0,10) == "CHANMODES=")
-                        {
-                               // By doing this we're *assuming* no other module has fucked up the CHANMODES=
-                               // section of the 005 numeric. If they have, we're going DOWN in a blaze of glory,
-                               // with a honking great EXCEPTION :)
-                               temp1.insert(temp1.find(",")+1,"L");
-                        }
-                        temp2 = temp2 + temp1 + " ";
-                }
-               if (temp2.length())
-                       output = temp2.substr(0,temp2.length()-1);
-        }
+       virtual void On005Numeric(std::string &output)
+       {
+               InsertMode(output, "L", 3);
+       }
        
        virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
        {