-// Removing user. Removing notifiers from user.
-std::list<TRF_IP_BEFORE>::iterator bi;
-std::list<TRF_IP_AFTER>::iterator ai;
-
-bi = ipBeforeNotifiers.begin();
-while (bi != ipBeforeNotifiers.end())
- {
- if (user->GetLogin() == bi->GetUser()->GetLogin())
- {
- user->DelCurrIPBeforeNotifier(&(*bi));
- ipBeforeNotifiers.erase(bi);
- break;
- }
- ++bi;
- }
-
-ai = ipAfterNotifiers.begin();
-while (ai != ipAfterNotifiers.end())
- {
- if (user->GetLogin() == ai->GetUser()->GetLogin())
- {
- user->DelCurrIPAfterNotifier(&(*ai));
- ipAfterNotifiers.erase(ai);
- break;
- }
- ++ai;
- }
+ // Removing user. Removing notifiers from user.
+ m_onIPConns.erase(std::remove_if(m_onIPConns.begin(), m_onIPConns.end(),
+ [user](const auto& cs){ return std::get<0>(cs) == user->GetID(); }),
+ m_onIPConns.end());