X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chghost.cpp;h=c327d27b32631780a54f8f665c2ac34714777738;hb=8e89fe75f9467969bce1dc6930befc6ef273edf6;hp=71fd678b3703c5db4c677c54a10fa44f27c87dfa;hpb=cadc11999ee28545e9beb92de116c151832af5c4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 71fd678b3..c327d27b3 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -22,16 +22,16 @@ class CommandChghost : public Command private: char* hostmap; public: - CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST",'o',2), hostmap(hmap) + CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap) { this->source = "m_chghost.so"; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const std::vector ¶meters, User *user) { - const char * x = parameters[1]; + const char * x = parameters[1].c_str(); for (; *x; x++) { @@ -41,13 +41,13 @@ class CommandChghost : public Command return CMD_FAILURE; } } - if (!*parameters[0]) + if (parameters[0].empty()) { user->WriteServ("NOTICE %s :*** CHGHOST: Host must be specified", user->nick); return CMD_FAILURE; } - if ((parameters[1] - x) > 63) + if ((parameters[1].c_str() - x) > 63) { user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick); return CMD_FAILURE; @@ -56,14 +56,14 @@ class CommandChghost : public Command if (!dest) { - user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]); + user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick, parameters[0].c_str()); return CMD_FAILURE; } - if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) + if ((dest->ChangeDisplayedHost(parameters[1].c_str())) && (!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); + ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); } /* route it! */ @@ -88,10 +88,6 @@ class ModuleChgHost : public Module ServerInstance->Modules->Attach(eventlist, this, 1); } - void Implements(char* List) - { - List[I_OnRehash] = 1; - } void OnRehash(User* user, const std::string ¶meter) { @@ -112,7 +108,7 @@ class ModuleChgHost : public Module Version GetVersion() { - return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); } };