summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd.h4
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/modules/m_nickflood.cpp3
-rw-r--r--src/modules/m_nicklock.cpp3
-rw-r--r--src/modules/m_nonicks.cpp4
-rw-r--r--src/users.cpp19
6 files changed, 9 insertions, 26 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index ed6f7df94..9a9583499 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -417,10 +417,6 @@ class CoreExport InspIRCd
*/
ProtocolInterface* PI;
- /** Holds extensible for user nickforced
- */
- LocalIntExt NICKForced;
-
/** Holds extensible for user operquit
*/
LocalStringExt OperQuit;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 775e6f130..67cf8707b 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -271,7 +271,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
* THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods
* themselves within the class.
*/
- NICKForced("NICKForced", NULL),
OperQuit("OperQuit", NULL),
GenRandom(&HandleGenRandom),
IsChannel(&HandleIsChannel),
@@ -282,7 +281,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
{
ServerInstance = this;
- Extensions.Register(&NICKForced);
Extensions.Register(&OperQuit);
FailedPortList pl;
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index e7533fc07..de9b64f99 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -150,9 +150,6 @@ class ModuleNickFlood : public Module
ModResult OnUserPreNick(User* user, const std::string &newnick) CXX11_OVERRIDE
{
- if (ServerInstance->NICKForced.get(user)) /* Allow forced nick changes */
- return MOD_RES_PASSTHRU;
-
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
Channel *channel = *i;
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp
index 8e0d5ae7f..d48687113 100644
--- a/src/modules/m_nicklock.cpp
+++ b/src/modules/m_nicklock.cpp
@@ -168,9 +168,6 @@ class ModuleNickLock : public Module
if (!IS_LOCAL(user))
return MOD_RES_PASSTHRU;
- if (ServerInstance->NICKForced.get(user)) /* Allow forced nick changes */
- return MOD_RES_PASSTHRU;
-
if (locked.get(user))
{
user->WriteNumeric(447, "%s :You cannot change your nickname (your nick is locked)",user->nick.c_str());
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 58fe054b5..8981097be 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -61,10 +61,6 @@ class ModuleNoNickChange : public Module
if (!IS_LOCAL(user))
return MOD_RES_PASSTHRU;
- // Allow forced nick changes.
- if (ServerInstance->NICKForced.get(user))
- return MOD_RES_PASSTHRU;
-
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
Channel* curr = *i;
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))