]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dccallow.cpp
Merge branch 'master+listmode'
[user/henk/code/inspircd.git] / src / modules / m_dccallow.cpp
index 487e4a7ed23fca65038e1d6a473ebe9de56f18ba..1b838be5ce3fc62fbafbeef3964aa74944e77eb6 100644 (file)
@@ -62,7 +62,7 @@ class CommandDccallow : public Command
                : Command(parent, "DCCALLOW", 0)
                , ext(Ext)
        {
-               syntax = "{[+|-]<nick> <time>|HELP|LIST}";
+               syntax = "[(+|-)<nick> [<time>]]|[LIST|HELP]";
                /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */
        }
 
@@ -205,7 +205,7 @@ class CommandDccallow : public Command
 
        void DisplayHelp(User* user)
        {
-               user->WriteNumeric(998, ":DCCALLOW [<+|->nick [time]] [list] [help]");
+               user->WriteNumeric(998, ":DCCALLOW [(+|-)<nick> [<time>]]|[LIST|HELP]");
                user->WriteNumeric(998, ":You may allow DCCs from specific users by specifying a");
                user->WriteNumeric(998, ":DCC allow for the user you want to receive DCCs from.");
                user->WriteNumeric(998, ":For example, to allow the user Brain to send you inspircd.exe");
@@ -225,6 +225,10 @@ class CommandDccallow : public Command
                user->WriteNumeric(998, ":  they will be removed from your DCCALLOW list.");
                user->WriteNumeric(998, ":  your DCCALLOW list will be deleted when you leave IRC.");
                user->WriteNumeric(999, ":End of DCCALLOW HELP");
+
+               LocalUser* localuser = IS_LOCAL(user);
+               if (localuser)
+                       localuser->CommandFloodPenalty += 4000;
        }
 
        void DisplayDCCAllowList(User* user)
@@ -264,11 +268,7 @@ class ModuleDCCAllow : public Module
 
                // remove their DCCALLOW list if they have one
                if (udl)
-               {
-                       userlist::iterator it = std::find(ul.begin(), ul.end(), user);
-                       if (it != ul.end())
-                               ul.erase(it);
-               }
+                       stdalgo::erase(ul, user);
 
                // remove them from any DCCALLOW lists
                // they are currently on