X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sanick.cpp;h=b3f0ec32cbdc23642ef71b5c6ab1e3bf3ce2c3c4;hb=de69e28a4a1aea89e410b693bbbb67890ecb0bd3;hp=cdefe4abb4b56d21a0f403c9ea6a86907c902a61;hpb=90b62dd99901b5b5d9ba620d07d004adf0cef361;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index cdefe4abb..b3f0ec32c 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.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 CommandSanick : public Command { public: - CommandSanick (InspIRCd* Instance) : Command(Instance,"SANICK", "o", 2, false, 0) + CommandSanick(Module* Creator) : Command(Creator,"SANICK", 2) { - this->source = "m_sanick.so"; - syntax = " "; + flags_needed = 'o'; Penalty = 0; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -60,35 +59,37 @@ class CommandSanick : public Command std::string newnick = target->nick; if (target->ForceNickChange(parameters[1].c_str())) { - ServerInstance->SNO->WriteToSnoMask('A', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]); ServerInstance->PI->SendSNONotice("A", oldnick+" used SANICK to change "+newnick+" to "+parameters[1]); } else { - ServerInstance->SNO->WriteToSnoMask('A', oldnick+" failed SANICK (from "+newnick+" to "+parameters[1]+")"); + ServerInstance->SNO->WriteToSnoMask('a', oldnick+" failed SANICK (from "+newnick+" to "+parameters[1]+")"); ServerInstance->PI->SendSNONotice("A", oldnick+" failed SANICK (from "+newnick+" to "+parameters[1]+")"); } - /* Yes, hit target and we have sent our NICK out, we can now bail */ - return CMD_LOCALONLY; } - /* No, route it on */ 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 ModuleSanick : public Module { - CommandSanick* mycommand; + CommandSanick cmd; public: - ModuleSanick(InspIRCd* Me) - : Module(Me) + ModuleSanick() + : cmd(this) { - - mycommand = new CommandSanick(ServerInstance); - ServerInstance->AddCommand(mycommand); - + ServerInstance->AddCommand(&cmd); } virtual ~ModuleSanick() @@ -97,7 +98,7 @@ class ModuleSanick : public Module virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides support for SANICK command", VF_OPTCOMMON | VF_VENDOR); } };