aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-06-20 16:20:19 +0200
committerGravatar Attila Molnar2014-06-20 16:20:19 +0200
commit1442193c79016ea60a8a6e7df66f758040b77c76 (patch)
treefdbfac6cbfa63f1f4e2286a97fa386812b1aee92 /src/users.cpp
parentIncrement serverstats::Collisions when a collision is handled, not when a mod... (diff)
Change the type of the user parameter in the OnUserPreNick() hook from User to LocalUser
No remote users were passed to this hook before. Remove needless IS_LOCAL() checks.
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 1290b92be..8b34cfe8d 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -619,11 +619,13 @@ bool User::ChangeNick(const std::string& newnick, bool force, time_t newts)
return false;
}
- if (!force)
+ LocalUser* const localuser = IS_LOCAL(this);
+ if (!force && localuser)
{
ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (this, newnick));
+ FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (localuser, newnick));
+ // If a module denied the change, abort now
if (MOD_RESULT == MOD_RES_DENY)
return false;
}