X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_saquit.cpp;h=d2fa8e89b086010c0eb2402ed0ca48e2af5860b3;hb=fed58f5c25915d60d40c0f407914ff7381902f9d;hp=388846803dcc414b910e1f354eff405d2a40d95a;hpb=7f9c6c5118261eac40d9bae22ac2c0ede670512d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 388846803..d2fa8e89b 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -2,36 +2,19 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * - * - * - * Written by Craig Edwards, Craig McLure, and others. + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * * This program is free but copyrighted software; see - * the file COPYING for details. + * the file COPYING for details. * * --------------------------------------------------- */ -using namespace std; - -/* - * SAQUIT module for InspIRCd - * Author: w00t - * Version: 1.0.0.0 - * - * Syntax: /SAQUIT [reason] - * Makes it appear as though has /quit with [reason] - * - */ - -#include -#include +#include "inspircd.h" #include "users.h" #include "channels.h" #include "modules.h" -#include "inspircd.h" /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */ @@ -59,11 +42,15 @@ class cmd_saquit : public command_t irc::stringjoiner reason_join(" ", parameters, 1, pcnt - 1); std::string line = reason_join.GetJoined(); - ServerInstance->WriteOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); + ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); userrec::QuitUser(ServerInstance, dest, line); return CMD_SUCCESS; } + else + { + user->WriteServ("NOTICE %s :*** Invalid nickname '%s'", user->nick, parameters[0]); + } return CMD_FAILURE; } @@ -74,7 +61,7 @@ class ModuleSaquit : public Module cmd_saquit* mycommand; public: ModuleSaquit(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_saquit(ServerInstance); @@ -92,29 +79,4 @@ class ModuleSaquit : public Module }; -// stuff down here is the module-factory stuff. For basic modules you can ignore this. - -class ModuleSaquitFactory : public ModuleFactory -{ - public: - ModuleSaquitFactory() - { - } - - ~ModuleSaquitFactory() - { - } - - virtual Module * CreateModule(InspIRCd* Me) - { - return new ModuleSaquit(Me); - } - -}; - - -extern "C" void * init_module( void ) -{ - return new ModuleSaquitFactory; -} - +MODULE_INIT(ModuleSaquit)