X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_motd.cpp;h=0e0785e9394d0a7034b492df02b878f5f39a0dc9;hb=9aa6c07d92fb9c1132f06b8c5781d77ee7086edb;hp=74c9740f1debac6effff6e9740142237474ea800;hpb=352eb2b29f2e3f759ef74344b4807b1b6dff8e59;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_motd.cpp b/src/commands/cmd_motd.cpp index 74c9740f1..0e0785e93 100644 --- a/src/commands/cmd_motd.cpp +++ b/src/commands/cmd_motd.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,17 +12,47 @@ */ #include "inspircd.h" -#include "commands/cmd_motd.h" -extern "C" DllExport Command* init_command(InspIRCd* Instance) +#ifndef __CMD_MOTD_H__ +#define __CMD_MOTD_H__ + +// include the common header files + +#include +#include +#include "inspircd.h" +#include "users.h" +#include "channels.h" + +/** Handle /MOTD. These command handlers can be reloaded by the core, + * and handle basic RFC1459 commands. Commands within modules work + * the same way, however, they can be fully unloaded, where these + * may not. + */ +class CommandMotd : public Command { - return new CommandMotd(Instance); -} + public: + /** Constructor for motd. + */ + CommandMotd ( Module* parent) : Command(parent,"MOTD",0,1) { syntax = "[]"; } + /** Handle command. + * @param parameters The parameters to the comamnd + * @param pcnt The number of parameters passed to teh command + * @param user The user issuing the command + * @return A value from CmdResult to indicate command success or failure. + */ + CmdResult Handle(const std::vector& parameters, User *user); +}; + +#endif + /** Handle /MOTD */ -CmdResult CommandMotd::Handle (const char**, int, User *user) +CmdResult CommandMotd::Handle (const std::vector&, User *user) { user->ShowMOTD(); return CMD_SUCCESS; } + +COMMAND_INIT(CommandMotd)