]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_info/cmd_info.cpp
Redo OnSetEndPoint logic to fix duplicate clones (#1549).
[user/henk/code/inspircd.git] / src / coremods / core_info / cmd_info.cpp
index 7f1e923c9296d42e8cf09e01a7ec2e25264073be..ee079493488e81005f653023b9978589192f3956 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Copyright (C) 2011 Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2007-2015 Robin Burchell <robin+git@viroteck.net>
  *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
 
 
 #include "inspircd.h"
+#include "core_info.h"
 
-/** Handle /INFO.
- */
-class CommandInfo : public Command
+CommandInfo::CommandInfo(Module* parent)
+       : ServerTargetCommand(parent, "INFO")
 {
- public:
-       /** Constructor for info.
-        */
-       CommandInfo(Module* parent) : Command(parent,"INFO")
-       {
-               Penalty = 4;
-               syntax = "[<servername>]";
-       }
-
-       /** Handle command.
-        * @param parameters The parameters to the command
-        * @param user The user issuing the command
-        * @return A value from CmdResult to indicate command success or failure.
-        */
-       CmdResult Handle(const std::vector<std::string>& parameters, User *user);
-       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
-       {
-               if (parameters.size() > 0)
-                       return ROUTE_UNICAST(parameters[0]);
-               return ROUTE_LOCALONLY;
-       }
-};
+       Penalty = 4;
+       syntax = "[<servername>]";
+}
 
 static const char* const lines[] = {
        "                   -/\\- \2InspIRCd\2 -\\/-",
        "                 November 2002 - Present",
        " ",
        "\2Core Developers\2:",
-       "    Craig Edwards,          Brain,      <brain@inspircd.org>",
-       "    Craig McLure,           Craig,      <craig@inspircd.org>",
-       "    Robin Burchell,         w00t,       <w00t@inspircd.org>",
+       "    Attila Molnar,          Attila,     <attilamolnar@hush.com>",
+       "    Peter Powell,           SaberUK,    <petpow@saberuk.com>",
+       " ",
+       "\2Former Developers\2:",
        "    Oliver Lupton,          Om,         <om@inspircd.org>",
        "    John Brooks,            Special,    <special@inspircd.org>",
        "    Dennis Friis,           peavey,     <peavey@inspircd.org>",
@@ -64,14 +46,14 @@ static const char* const lines[] = {
        "    Uli Schlachter,         psychon,    <psychon@inspircd.org>",
        "    Matt Smith,             dz,         <dz@inspircd.org>",
        "    Daniel De Graaf,        danieldg,   <danieldg@inspircd.org>",
-       "                            jackmcbarn, <jackmcbarn@inspircd.org>",
-       "    Attila Molnar,          Attila,     <attilamolnar@hush.com>",
        " ",
-       "\2Regular Contributors\2:",
-       "    Adam           SaberUK",
+       "\2Founding Developers\2:",
+       "    Craig Edwards,          Brain,      <brain@inspircd.org>",
+       "    Craig McLure,           Craig,      <craig@inspircd.org>",
+       "    Robin Burchell,         w00t,       <w00t@inspircd.org>",
        " ",
-       "\2Other Contributors\2:",
-       "    ChrisTX        Shawn           Shutter",
+       "\2Active Contributors\2:",
+       "    Adam           linuxdaemon     Sheogorath",
        " ",
        "\2Former Contributors\2:",
        "   dmb             Zaba            skenmy         GreenReaper",
@@ -79,13 +61,14 @@ static const char* const lines[] = {
        "   Adremelech      John2           jilles         HiroP",
        "   eggy            Bricker         AnMaster       djGrrr",
        "   nenolod         Quension        praetorian     pippijn",
-       "   CC              jamie           typobox43      Burlex (win32)",
+       "   CC              jamie           typobox43      Burlex",
        "   Stskeeps        ThaPrince       BuildSmart     Thunderhacker",
        "   Skip            LeaChim         Majic          MacGyver",
        "   Namegduf        Ankit           Phoenix        Taros",
+       "   jackmcbarn      ChrisTX         Shawn          Shutter",
        " ",
        "\2Thanks To\2:",
-       "   searchirc.com   irc-junkie.org  Brik           fraggeln",
+       "   Asmo            Brik            fraggeln       genius3000",
        " ",
        " Best experienced with: \2An IRC client\2",
        NULL
@@ -93,17 +76,15 @@ static const char* const lines[] = {
 
 /** Handle /INFO
  */
-CmdResult CommandInfo::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandInfo::Handle(User* user, const Params& parameters)
 {
        if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
                return CMD_SUCCESS;
 
        int i=0;
        while (lines[i])
-               user->SendText(":%s %03d %s :%s", ServerInstance->Config->ServerName.c_str(), RPL_INFO, user->nick.c_str(), lines[i++]);
-       FOREACH_MOD(OnInfo, (user));
-       user->SendText(":%s %03d %s :End of /INFO list", ServerInstance->Config->ServerName.c_str(), RPL_ENDOFINFO, user->nick.c_str());
+               user->WriteRemoteNumeric(RPL_INFO, lines[i++]);
+
+       user->WriteRemoteNumeric(RPL_ENDOFINFO, "End of /INFO list");
        return CMD_SUCCESS;
 }
-
-COMMAND_INIT(CommandInfo)