summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-03 12:06:31 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-03 12:06:31 +0200
commit4ab1eb3d1e54d205317dafad538138bb40feace9 (patch)
treec6d3c5602e59eb3f679fef2bf09fdb647c0d4fa2
parentac76c832925b786e188fc2c45da5fb7ae5128df3 (diff)
core_user Inherit CommandNick from SplitCommand, only handle it for local users
-rw-r--r--src/coremods/core_user/cmd_nick.cpp10
-rw-r--r--src/coremods/core_user/core_user.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp
index 166941c6d..49e5efacc 100644
--- a/src/coremods/core_user/cmd_nick.cpp
+++ b/src/coremods/core_user/cmd_nick.cpp
@@ -24,7 +24,7 @@
#include "core_user.h"
CommandNick::CommandNick(Module* parent)
- : Command(parent, "NICK", 1, 1)
+ : SplitCommand(parent, "NICK", 1, 1)
{
works_before_reg = true;
syntax = "<newnick>";
@@ -36,14 +36,14 @@ CommandNick::CommandNick(Module* parent)
* for the client introduction code in here, youre in the wrong place.
* You need to look in the spanningtree module for this!
*/
-CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandNick::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
{
std::string oldnick = user->nick;
std::string newnick = parameters[0];
// anything except the initial NICK gets a flood penalty
- if (user->registered == REG_ALL && IS_LOCAL(user))
- IS_LOCAL(user)->CommandFloodPenalty += 4000;
+ if (user->registered == REG_ALL)
+ user->CommandFloodPenalty += 4000;
if (newnick.empty())
{
@@ -71,7 +71,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
{
/* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */
ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnUserRegister, MOD_RESULT, (IS_LOCAL(user)));
+ FIRST_MOD_RESULT(OnUserRegister, MOD_RESULT, (user));
if (MOD_RESULT == MOD_RES_DENY)
return CMD_FAILURE;
diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h
index 9c63e6592..4c91a39ab 100644
--- a/src/coremods/core_user/core_user.h
+++ b/src/coremods/core_user/core_user.h
@@ -64,7 +64,7 @@ class CommandAway : public Command
/** Handle /NICK.
*/
-class CommandNick : public Command
+class CommandNick : public SplitCommand
{
public:
/** Constructor for nick.
@@ -76,7 +76,7 @@ class CommandNick : public 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);
+ CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
};
/** Handle /PART.