]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_kline.cpp
Add userrec::HasMode, fix some typos.
[user/henk/code/inspircd.git] / src / cmd_kline.cpp
index 370c3a45f3c0a31d7538880217d12c261d60fbda..e841129592a1659a6fe3635f4d7fe467fd6ad217 100644 (file)
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include "inspircd_config.h"
-#include "inspircd.h"
-#include "inspircd_io.h"
 #include <time.h>
 #include <string>
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
 #include <map>
 #include <sstream>
 #include <vector>
 #include <deque>
+
+#include "inspircd_config.h"
+#include "configreader.h"
+#include "hash_map.h"
 #include "users.h"
-#include "ctables.h"
-#include "globals.h"
 #include "modules.h"
-#include "dynamic.h"
-#include "wildcard.h"
-#include "message.h"
 #include "commands.h"
-#include "mode.h"
 #include "xline.h"
-#include "inspstring.h"
-#include "dnsqueue.h"
 #include "helperfuncs.h"
-#include "hashcomp.h"
-#include "socketengine.h"
-#include "typedefs.h"
-#include "command_parse.h"
-#include "cmd_kline.h"
+#include "commands/cmd_kline.h"
 
 extern ServerConfig* Config;
-extern InspIRCd* ServerInstance;
 extern int MODCOUNT;
 extern std::vector<Module*> modules;
 extern std::vector<ircd_module*> factory;
 extern time_t TIME;
-extern user_hash clientlist;
-extern chan_hash chanlist;
-
-extern std::vector<userrec*> all_opers;
-extern std::vector<userrec*> local_users;
-extern userrec* fd_ref_table[MAX_DESCRIPTORS];
 
 void cmd_kline::Handle (char **parameters, int pcnt, userrec *user)
 {
@@ -68,16 +43,19 @@ void cmd_kline::Handle (char **parameters, int pcnt, userrec *user)
        {
                if (host_matches_everyone(parameters[0],user))
                        return;
+
                add_kline(duration(parameters[1]),user->nick,parameters[2],parameters[0]);
                FOREACH_MOD(I_OnAddKLine,OnAddKLine(duration(parameters[1]), user, parameters[2], parameters[0]));
+
                if (!duration(parameters[1]))
                {
-                       WriteOpers("*** %s added permenant K-line for %s.",user->nick,parameters[0]);
+                       WriteOpers("*** %s added permanent K-line for %s.",user->nick,parameters[0]);
                }
                else
                {
                        WriteOpers("*** %s added timed K-line for %s, expires in %d seconds.",user->nick,parameters[0],duration(parameters[1]));
                }
+
                apply_lines(APPLY_KLINES);
        }
        else
@@ -93,5 +71,3 @@ void cmd_kline::Handle (char **parameters, int pcnt, userrec *user)
                }
        }
 }
-
-