]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Lower the acceptable drift for clocks on link.
[user/henk/code/inspircd.git] / src / users.cpp
index 37e3814855b3555d71303bcd3d5463da48ea5c62..b8a2d31a83750669f7ea9f3ff006b42029d9103b 100644 (file)
@@ -314,10 +314,10 @@ bool UserIOHandler::OnSetEndPoint(const irc::sockets::sockaddrs& server, const i
        return !user->quitting;
 }
 
-void UserIOHandler::OnError(BufferedSocketError error)
+void UserIOHandler::OnError(BufferedSocketError sockerr)
 {
        ModResult res;
-       FIRST_MOD_RESULT(OnConnectionFail, res, (user, error));
+       FIRST_MOD_RESULT(OnConnectionFail, res, (user, sockerr));
        if (res != MOD_RES_ALLOW)
                ServerInstance->Users->QuitUser(user, getError());
 }
@@ -441,6 +441,13 @@ void User::UnOper()
         */
        oper = NULL;
 
+       // Remove the user from the oper list
+       stdalgo::vector::swaperase(ServerInstance->Users->all_opers, this);
+
+       // If the user is quitting we shouldn't remove any modes as it results in
+       // mode messages being broadcast across the network.
+       if (quitting)
+               return;
 
        /* Remove all oper only modes from the user when the deoper - Bug #466*/
        Modes::ChangeList changelist;
@@ -454,9 +461,6 @@ void User::UnOper()
 
        ServerInstance->Modes->Process(this, NULL, this, changelist);
 
-       // Remove the user from the oper list
-       stdalgo::vector::swaperase(ServerInstance->Users->all_opers, this);
-
        ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
        if (opermh)
                this->SetMode(opermh, false);