From f3d134a5b642b83e865c03b45c313df7f829ba15 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 16 May 2013 16:00:19 +0200 Subject: Get rid of the NICKForced extension Don't run OnUserPreNick when the nick change is forced --- src/users.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 460f97a18..f7dafeb86 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -795,17 +795,16 @@ bool User::ChangeNick(const std::string& newnick, bool force) return false; } - ModResult MOD_RESULT; - - if (force) - ServerInstance->NICKForced.set(this, 1); - FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (this, newnick)); - ServerInstance->NICKForced.set(this, 0); - - if (MOD_RESULT == MOD_RES_DENY) + if (!force) { - ServerInstance->stats->statsCollisions++; - return false; + ModResult MOD_RESULT; + FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (this, newnick)); + + if (MOD_RESULT == MOD_RES_DENY) + { + ServerInstance->stats->statsCollisions++; + return false; + } } if (assign(newnick) == assign(nick)) -- cgit v1.3.1-10-gc9f91