X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_privmsg.cpp;h=0eacfd0bcc31d8663f8b99609c42e714bd8344e2;hb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;hp=5861bd08688da871eed59ccda67800e11072fbad;hpb=f4472dd6dcdfbb5d4a2a50ddc615644c3b2c8145;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 5861bd086..0eacfd0bc 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -13,14 +13,6 @@ #include "inspircd.h" -#ifndef __CMD_PRIVMSG_H__ -#define __CMD_PRIVMSG_H__ - -// include the common header files - -#include "users.h" -#include "channels.h" - /** 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 @@ -31,7 +23,7 @@ class CommandPrivmsg : public Command public: /** Constructor for privmsg. */ - CommandPrivmsg (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"PRIVMSG",0,2) { syntax = "{,} "; } + CommandPrivmsg ( Module* parent) : Command(parent,"PRIVMSG",2,2) { syntax = "{,} "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command @@ -41,9 +33,6 @@ class CommandPrivmsg : public Command CmdResult Handle(const std::vector& parameters, User *user); }; -#endif - - CmdResult CommandPrivmsg::Handle (const std::vector& parameters, User *user) { User *dest; @@ -62,7 +51,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, except_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, except_list)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; @@ -89,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)) { @@ -119,7 +108,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status,except_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status,except_list)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE; @@ -203,7 +192,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us ModResult MOD_RESULT; std::string temp = parameters[1]; - FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user, dest, TYPE_USER, temp, 0, except_list)); + FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, dest, TYPE_USER, temp, 0, except_list)); if (MOD_RESULT == MOD_RES_DENY) return CMD_FAILURE;