X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgident.cpp;h=135b26446d973a36c7f3391d40b26f155e258895;hb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;hp=1c73319586520af9782e0f8514d2e3167eb03dbd;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 1c7331958..135b26446 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -20,10 +20,9 @@ class CommandChgident : public Command { public: - CommandChgident (InspIRCd* Instance) : Command(Instance,"CHGIDENT", "o", 2) + CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2) { - this->source = "m_chgident.so"; - syntax = " "; + flags_needed = 'o'; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -55,28 +54,35 @@ class CommandChgident : public Command return CMD_FAILURE; } - dest->ChangeIdent(parameters[1].c_str()); + if (IS_LOCAL(dest)) + { + dest->ChangeIdent(parameters[1].c_str()); - if (!ServerInstance->ULine(user->server)) - ServerInstance->SNO->WriteToSnoMask('A', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str()); + if (!ServerInstance->ULine(user->server)) + ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str()); + } - /* route it! */ return CMD_SUCCESS; } + + RouteDescriptor GetRouting(User* user, const std::vector& parameters) + { + User* dest = ServerInstance->FindNick(parameters[0]); + if (dest) + return ROUTE_OPT_UCAST(dest->server); + return ROUTE_LOCALONLY; + } }; class ModuleChgIdent : public Module { - CommandChgident* mycommand; - + CommandChgident cmd; public: - ModuleChgIdent(InspIRCd* Me) : Module(Me) + ModuleChgIdent() : cmd(this) { - mycommand = new CommandChgident(ServerInstance); - ServerInstance->AddCommand(mycommand); - + ServerInstance->AddCommand(&cmd); } virtual ~ModuleChgIdent() @@ -85,7 +91,7 @@ public: virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides support for the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR, API_VERSION); } };