From c25a59d9036444872d831a126c6326f3d8be5e74 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 13 Jun 2013 18:41:10 +0200 Subject: Remove TR_END, remove TRANSLATEx() from commands that do not need it --- include/ctables.h | 1 - src/command_parse.cpp | 1 - src/commands/cmd_kill.cpp | 2 +- src/modules/m_alltime.cpp | 1 - src/modules/m_callerid.cpp | 2 +- src/modules/m_cban.cpp | 1 - src/modules/m_chghost.cpp | 2 +- src/modules/m_chgident.cpp | 2 +- src/modules/m_chgname.cpp | 2 +- src/modules/m_cycle.cpp | 1 - src/modules/m_devoice.cpp | 1 - src/modules/m_globalload.cpp | 1 - src/modules/m_globops.cpp | 1 - src/modules/m_knock.cpp | 1 - src/modules/m_nicklock.cpp | 4 ++-- src/modules/m_ojoin.cpp | 1 - src/modules/m_remove.cpp | 4 ++-- src/modules/m_sajoin.cpp | 2 +- src/modules/m_sakick.cpp | 2 +- src/modules/m_sanick.cpp | 2 +- src/modules/m_sapart.cpp | 2 +- src/modules/m_saquit.cpp | 2 +- src/modules/m_sethost.cpp | 1 - src/modules/m_setident.cpp | 1 - src/modules/m_setidle.cpp | 1 - src/modules/m_setname.cpp | 1 - src/modules/m_silence.cpp | 3 +-- src/modules/m_svshold.cpp | 1 - src/modules/m_swhois.cpp | 2 +- src/modules/m_timedbans.cpp | 1 - src/modules/m_uninvite.cpp | 2 +- src/modules/m_watch.cpp | 3 +-- 32 files changed, 18 insertions(+), 36 deletions(-) diff --git a/include/ctables.h b/include/ctables.h index 6ead8081f..f6d712937 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -43,7 +43,6 @@ const char FLAG_SERVERONLY = 7; // technically anything nonzero below 'A' works */ enum TranslateType { - TR_END, /* End of known parameters, everything after this is TR_TEXT */ TR_TEXT, /* Raw text, leave as-is */ TR_NICK, /* Nickname, translate to UUID for server->server */ TR_CUSTOM /* Custom translation handled by EncodeParameter/DecodeParameter */ diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 08e28557c..31e61d161 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -435,7 +435,6 @@ void CommandParser::TranslateSingleParam(TranslateType to, const std::string& it } // If no custom translator was given, fall through } - case TR_END: case TR_TEXT: default: /* Do nothing */ diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 74024f84e..dddfe4291 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -37,7 +37,7 @@ class CommandKill : public Command CommandKill ( Module* parent) : Command(parent,"KILL",2,2) { flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_CUSTOM, TR_CUSTOM, TR_END); + TRANSLATE2(TR_CUSTOM, TR_CUSTOM); } /** Handle command. * @param parameters The parameters to the comamnd diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index d0331a994..3e634b056 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -29,7 +29,6 @@ class CommandAlltime : public Command CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { flags_needed = 'o'; - translation.push_back(TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 91d417b10..1f9766883 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -169,7 +169,7 @@ public: { allow_empty_last_param = false; syntax = "{[+|-]}|*}"; - TRANSLATE2(TR_CUSTOM, TR_END); + TRANSLATE1(TR_CUSTOM); } void EncodeParameter(std::string& parameter, int index) diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 7dedb7441..b7113eb31 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -88,7 +88,6 @@ class CommandCBan : public Command CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3) { flags_needed = 'o'; this->syntax = " [ :]"; - TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index bae83f2da..0d092b9f1 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -34,7 +34,7 @@ class CommandChghost : public Command allow_empty_last_param = false; flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index f7777c24e..3ae21c2d2 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -34,7 +34,7 @@ class CommandChgident : public Command allow_empty_last_param = false; flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index bdeb8a44b..521447842 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -32,7 +32,7 @@ class CommandChgname : public Command allow_empty_last_param = false; flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 66d124eb8..68b7399a1 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -31,7 +31,6 @@ class CommandCycle : public SplitCommand : SplitCommand(Creator, "CYCLE", 1) { Penalty = 3; syntax = " :[reason]"; - TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } CmdResult HandleLocal(const std::vector ¶meters, LocalUser* user) diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 889658d20..1d203c9fe 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -36,7 +36,6 @@ class CommandDevoice : public Command CommandDevoice(Module* Creator) : Command(Creator,"DEVOICE", 1) { syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 7ceb28115..6f696f686 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -35,7 +35,6 @@ class CommandGloadmodule : public Command { flags_needed = 'o'; syntax = " [servermask]"; - TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index 53112e39e..8377a255e 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -33,7 +33,6 @@ class CommandGlobops : public Command CommandGlobops(Module* Creator) : Command(Creator,"GLOBOPS", 1,1) { flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 4c29fe6bc..4978f6629 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -34,7 +34,6 @@ class CommandKnock : public Command { syntax = " "; Penalty = 5; - TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 7bd2c43b2..1d14460e6 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -35,7 +35,7 @@ class CommandNicklock : public Command { flags_needed = 'o'; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector& parameters, User *user) @@ -98,7 +98,7 @@ class CommandNickunlock : public Command { flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_NICK, TR_END); + TRANSLATE1(TR_NICK); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 4aec2933a..2c0398862 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -54,7 +54,6 @@ class CommandOjoin : public SplitCommand { flags_needed = 'o'; Penalty = 0; syntax = ""; active = false; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } CmdResult HandleLocal(const std::vector& parameters, LocalUser* user) diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index d4b7ca42f..ee44e77ff 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -148,7 +148,7 @@ class CommandRemove : public RemoveBase : RemoveBase(Creator, snk, "REMOVE") { syntax = " []"; - TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); + TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) @@ -174,7 +174,7 @@ class CommandFpart : public RemoveBase : RemoveBase(Creator, snk, "FPART") { syntax = " []"; - TRANSLATE4(TR_TEXT, TR_NICK, TR_TEXT, TR_END); + TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 205cd6569..dcb79b8e8 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -32,7 +32,7 @@ class CommandSajoin : public Command { allow_empty_last_param = false; flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 0d36ca8ae..5b92114b5 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -30,7 +30,7 @@ class CommandSakick : public Command CommandSakick(Module* Creator) : Command(Creator,"SAKICK", 2, 3) { flags_needed = 'o'; Penalty = 0; syntax = " [reason]"; - TRANSLATE4(TR_TEXT, TR_NICK, TR_TEXT, TR_END); + TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 01899dd0a..98b4c1eb9 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -32,7 +32,7 @@ class CommandSanick : public Command { allow_empty_last_param = false; flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index e8cd2b5d1..b23c8757f 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -31,7 +31,7 @@ class CommandSapart : public Command CommandSapart(Module* Creator) : Command(Creator,"SAPART", 2, 3) { flags_needed = 'o'; Penalty = 0; syntax = " [reason]"; - TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); + TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index b74660487..7a78cada1 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -31,7 +31,7 @@ class CommandSaquit : public Command CommandSaquit(Module* Creator) : Command(Creator, "SAQUIT", 2, 2) { flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index e3e02fbe8..bc1701049 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -34,7 +34,6 @@ class CommandSethost : public Command { allow_empty_last_param = false; flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index 2ad886fcd..72878471c 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -33,7 +33,6 @@ class CommandSetident : public Command { allow_empty_last_param = false; flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle(const std::vector& parameters, User *user) diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 90943f9ef..4cebc2e6f 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -31,7 +31,6 @@ class CommandSetidle : public SplitCommand CommandSetidle(Module* Creator) : SplitCommand(Creator,"SETIDLE", 1) { flags_needed = 'o'; syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult HandleLocal(const std::vector& parameters, LocalUser* user) diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index ee42d3852..51ea2fae4 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -32,7 +32,6 @@ class CommandSetname : public Command { allow_empty_last_param = false; syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 0e9a45720..b0ce8f56c 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -66,7 +66,7 @@ class CommandSVSSilence : public Command CommandSVSSilence(Module* Creator) : Command(Creator,"SVSSILENCE", 2) { syntax = " {[+|-] }"; - TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */ + TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) @@ -112,7 +112,6 @@ class CommandSilence : public Command { allow_empty_last_param = false; syntax = "{[+|-] }"; - TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const std::vector& parameters, User *user) diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index a53298126..2815a2c6f 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -84,7 +84,6 @@ class CommandSvshold : public Command CommandSvshold(Module* Creator) : Command(Creator, "SVSHOLD", 1) { flags_needed = 'o'; this->syntax = " [ :]"; - TRANSLATE4(TR_TEXT, TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index a00d60960..9e461e627 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -36,7 +36,7 @@ class CommandSwhois : public Command CommandSwhois(Module* Creator) : Command(Creator,"SWHOIS", 2,2), swhois("swhois", Creator) { flags_needed = 'o'; syntax = " :"; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle(const std::vector ¶meters, User* user) diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 93245432d..3602469bd 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -45,7 +45,6 @@ class CommandTban : public Command CommandTban(Module* Creator) : Command(Creator,"TBAN", 3) { syntax = " "; - TRANSLATE4(TR_TEXT, TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index 79a0d8eec..736211da3 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -32,7 +32,7 @@ class CommandUninvite : public Command CommandUninvite(Module* Creator) : Command(Creator,"UNINVITE", 2) { syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector ¶meters, User *user) diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 712699775..c1a24974b 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -107,7 +107,7 @@ class CommandSVSWatch : public Command CommandSVSWatch(Module* Creator) : Command(Creator,"SVSWATCH", 2) { syntax = " [C|L|S]|[+|-]"; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */ + TRANSLATE2(TR_NICK, TR_TEXT); /* we watch for a nick. not a UID. */ } CmdResult Handle (const std::vector ¶meters, User *user) @@ -255,7 +255,6 @@ class CommandWatch : public Command CommandWatch(Module* parent, unsigned int &maxwatch) : Command(parent,"WATCH", 0), MAX_WATCH(maxwatch), ext("watchlist", parent) { syntax = "[C|L|S]|[+|-]"; - TRANSLATE2(TR_TEXT, TR_END); /* we watch for a nick. not a UID. */ } CmdResult Handle (const std::vector ¶meters, User *user) -- cgit v1.2.3