X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_privmsg.cpp;h=e05366fa059cd8a32c71165bd21ba1efc4e0da8b;hb=91df762e93212958db487d8517addba1a63a4ddd;hp=c6e74db8b134ab32053baca2cedddd016d75f10d;hpb=86775e2e98f55b3b88befe2daff0ca23f02f3155;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index c6e74db8b..e05366fa0 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -12,12 +12,26 @@ */ #include "inspircd.h" -#include "commands/cmd_privmsg.h" -extern "C" DllExport Command* init_command(InspIRCd* Instance) +/** Handle /PRIVMSG. 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 CommandPrivmsg : public Command { - return new CommandPrivmsg(Instance); -} + public: + /** Constructor for privmsg. + */ + CommandPrivmsg (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"PRIVMSG",0,2) { 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); +}; CmdResult CommandPrivmsg::Handle (const std::vector& parameters, User *user) { @@ -64,11 +78,11 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us { chan = ServerInstance->FindChan(target); - except_list[user] = user->nick; + except_list.insert(user); if (chan) { - if (IS_LOCAL(user) && chan->GetStatus(user) < STATUS_VOICE) + if (IS_LOCAL(user) && chan->GetPrefixValue(user) < VOICE_VALUE) { if (chan->IsModeSet('n') && !chan->HasUser(user)) { @@ -202,3 +216,5 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us } return CMD_SUCCESS; } + +COMMAND_INIT(CommandPrivmsg)