From a8b19c295d3a105005d47ef9de04412fcb14d2e8 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 4 Feb 2008 13:56:11 +0000 Subject: Brain, look at this please git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8817 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'src/users.cpp') 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 dummy; Command* nickhandler = ServerInstance->Parser->GetHandler("NICK"); -- cgit v1.2.3