From ef77989a9d067de7a51fcfae16df82f390ff5bb5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 31 Jul 2019 21:25:44 +0100 Subject: Stop removing oper modes after a user have been quit network-wide. Fixes #1686. --- src/users.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 37e381485..cfdd1f0b5 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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); -- cgit v1.3.1-10-gc9f91 From d5ed9d15c1d16d8ea0fd2a9087cf04016ce91345 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 1 Aug 2019 12:58:22 +0100 Subject: Fix a shadowing warning in UserIOHandler::OnError. --- src/users.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index cfdd1f0b5..b8a2d31a8 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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()); } -- cgit v1.3.1-10-gc9f91