X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chghost.cpp;h=727495932b41092641fe312792368a0cd7d166a7;hb=52acbb466b84a1cd161b1c111f855d6f0419fff3;hp=d4047ad4828a0c3807cb589660e12d4aadf6b5ce;hpb=63b08e012f6ac0fba7b498840ef6fe3c141aed4d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index d4047ad48..727495932 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -11,14 +11,11 @@ * --------------------------------------------------- */ -#include -#include +#include "inspircd.h" #include "users.h" #include "channels.h" #include "modules.h" -#include "inspircd.h" - /* $ModDesc: Provides support for the CHGHOST command */ /** Handle /CHGHOST @@ -52,17 +49,22 @@ class cmd_chghost : public command_t return CMD_FAILURE; } userrec* dest = ServerInstance->FindNick(parameters[0]); - if (dest) + + if (!dest) { - if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) - { - // fix by brain - ulines set hosts silently - ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); - } - return CMD_SUCCESS; + /* Drop it like a hot potato. XXX - we should probably message here.. -- w00t */ + return CMD_FAILURE; } - return CMD_FAILURE; + if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) + { + // fix by brain - ulines set hosts silently + ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); + } + + /* route it! */ + return CMD_SUCCESS; + } }; @@ -73,7 +75,7 @@ class ModuleChgHost : public Module char hostmap[256]; public: ModuleChgHost(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { OnRehash(NULL,""); mycommand = new cmd_chghost(ServerInstance, hostmap); @@ -129,7 +131,7 @@ class ModuleChgHostFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChgHostFactory; }