From: Maxim Mamontov Date: Tue, 13 Sep 2011 14:22:37 +0000 (+0300) Subject: Code cleanup X-Git-Tag: 2.408-rc1~74 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/bd81e49c054c7a196c01e901a5e41f6896bad4d8?hp=3c6b99f269e502e31ee14b1ae9060de334012c82 Code cleanup --- diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index 6b87b5a9..19be5a41 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -180,7 +180,6 @@ u.OnAdd(); users.push_front(u); AddUserIntoIndexes(users.begin()); -SetUserNotifiers(users.begin()); { // Fire all "on add" notifiers @@ -260,7 +259,6 @@ if (!priv->userAddDel) utd.delTime = stgTime; usersToDelete.push_back(utd); - UnSetUserNotifiers(u); DelUserFromIndexes(u); WriteServLog("%s User \'%s\' deleted.", @@ -342,7 +340,6 @@ for (unsigned int i = 0; i < usersList.size(); i++) ui = users.begin(); AddUserIntoIndexes(ui); - SetUserNotifiers(ui); if (ui->ReadConf() < 0) return -1; @@ -413,7 +410,6 @@ while (us->nonstop) user_iter ui = us->users.begin(); while (ui != us->users.end()) { - us->UnSetUserNotifiers(ui); us->DelUserFromIndexes(ui); ++ui; } @@ -803,54 +799,6 @@ WriteServLog("USERS. Incorrect search handle."); return -1; } //----------------------------------------------------------------------------- -void USERS_IMPL::SetUserNotifiers(user_iter user) -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); - -/*PROPERTY_NOTIFER_IP_BEFORE nb(*this, user); -PROPERTY_NOTIFER_IP_AFTER na(*this, user); - -userIPNotifiersBefore.push_front(nb); -userIPNotifiersAfter.push_front(na); - -user->AddCurrIPBeforeNotifier(&(*userIPNotifiersBefore.begin())); -user->AddCurrIPAfterNotifier(&(*userIPNotifiersAfter.begin()));*/ -} -//----------------------------------------------------------------------------- -void USERS_IMPL::UnSetUserNotifiers(user_iter user) -{ -STG_LOCKER lock(&mutex, __FILE__, __LINE__); - -/*list::iterator bi; -list::iterator ai; - -bi = userIPNotifiersBefore.begin(); -while (bi != userIPNotifiersBefore.end()) - { - if (bi->GetUser() == user) - { - bi->GetUser()->DelCurrIPBeforeNotifier(&(*bi)); - userIPNotifiersBefore.erase(bi); - //printfd(__FILE__, "Notifier Before removed. User %s\n", bi->GetUser()->GetLogin().c_str()); - break; - } - ++bi; - } - -ai = userIPNotifiersAfter.begin(); -while (ai != userIPNotifiersAfter.end()) - { - if (ai->GetUser() == user) - { - ai->GetUser()->DelCurrIPAfterNotifier(&(*ai)); - userIPNotifiersAfter.erase(ai); - //printfd(__FILE__, "Notifier After removed. User %s\n", ai->GetUser()->GetLogin().c_str()); - break; - } - ++ai; - }*/ -} -//----------------------------------------------------------------------------- void USERS_IMPL::AddUserIntoIndexes(user_iter user) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); diff --git a/projects/stargazer/users_impl.h b/projects/stargazer/users_impl.h index de1a2d40..a7af2989 100644 --- a/projects/stargazer/users_impl.h +++ b/projects/stargazer/users_impl.h @@ -142,9 +142,6 @@ private: void RealDelUser(); void ProcessActions(); - void SetUserNotifiers(user_iter user); - void UnSetUserNotifiers(user_iter user); - void AddUserIntoIndexes(user_iter user); void DelUserFromIndexes(user_iter user); @@ -157,8 +154,6 @@ private: std::list users; std::list usersToDelete; - /*std::list userIPNotifiersBefore; - std::list userIPNotifiersAfter;*/ std::map ipIndex; std::map loginIndex;