diff options
-rw-r--r-- | src/users.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/users.cpp b/src/users.cpp index 7847d8281..edcc54be5 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -884,25 +884,33 @@ bool User::ForceNickChange(const char* newnick) { try { - int MOD_RESULT = 0; + /* + * XXX this makes no sense.. + * why do we do nothing for change on users not REG_ALL? + * why do we trigger events twice for everyone previously (and just them now) + * i think the first if () needs removing totally, or? -- w00t + */ + if (this->registered != REG_ALL) + { + int MOD_RESULT = 0; - this->InvalidateCache(); + this->InvalidateCache(); - FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(this, newnick)); + FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(this, newnick)); - if (MOD_RESULT) - { - ServerInstance->stats->statsCollisions++; - return false; - } + if (MOD_RESULT) + { + ServerInstance->stats->statsCollisions++; + return false; + } - if (ServerInstance->XLines->MatchesLine("Q",newnick)) - { - ServerInstance->stats->statsCollisions++; - return false; + if (ServerInstance->XLines->MatchesLine("Q",newnick)) + { + ServerInstance->stats->statsCollisions++; + return false; + } } - - if (this->registered == REG_ALL) + else { std::deque<classbase*> dummy; Command* nickhandler = ServerInstance->Parser->GetHandler("NICK"); |