summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_nonicks.cpp4
-rw-r--r--src/users.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index a7f7b142f..14957759c 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -81,6 +81,10 @@ class ModuleNoNickChange : public Module
if (isdigit(newnick[0])) /* don't even think about touching a switch to uid! */
return 0;
+ // Allow forced nick changes.
+ if (user->GetExt("NICKForced"))
+ return 0;
+
for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
{
Channel* curr = i->first;
diff --git a/src/users.cpp b/src/users.cpp
index d108a314e..fd71b07ad 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1038,8 +1038,12 @@ bool User::ForceNickChange(const char* newnick)
this->InvalidateCache();
+ this->Extend("NICKForced", "Enabled");
+
FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(this, newnick));
+ this->Shrink("NICKForced");
+
if (MOD_RESULT)
{
ServerInstance->stats->statsCollisions++;