]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_unloadmodule.cpp
1bb99014b68cda35a06387676c6716ef2c18d2c9
[user/henk/code/inspircd.git] / src / cmd_unloadmodule.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include "inspircd.h"
18 #include "users.h"
19 #include "commands/cmd_unloadmodule.h"
20
21
22
23 extern "C" command_t* init_command(InspIRCd* Instance)
24 {
25         return new cmd_unloadmodule(Instance);
26 }
27
28 void cmd_unloadmodule::Handle (const char** parameters, int pcnt, userrec *user)
29 {
30         if (ServerInstance->UnloadModule(parameters[0]))
31         {
32                 ServerInstance->WriteOpers("*** MODULE UNLOADED: %s",parameters[0]);
33                 user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
34         }
35         else
36         {
37                 user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
38         }
39 }