]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Destroy Memberships of a quitting user in QuitUser() instead of in cull()
authorAttila Molnar <attilamolnar@hush.com>
Sat, 25 Jan 2014 11:15:01 +0000 (12:15 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 25 Jan 2014 11:15:01 +0000 (12:15 +0100)
src/channels.cpp
src/usermanager.cpp
src/users.cpp

index 39265764738e7b35aa8c39b9778d1e60c7fdb259..20d61e1d4afa93df84c712388456cc3e22c12678 100644 (file)
@@ -678,8 +678,6 @@ void Channel::UserList(User *user)
        std::string nick;
        for (UserMembIter i = userlist.begin(); i != userlist.end(); ++i)
        {
-               if (i->first->quitting)
-                       continue;
                if ((!has_user) && (i->first->IsModeSet(invisiblemode)) && (!has_privs))
                {
                        /*
index 13646f225c2abf1e75d6b1e4b6f7b16a7ef8ed97..b5050d91a56c4a17bda9be5cf9628b74741193be 100644 (file)
@@ -209,6 +209,7 @@ void UserManager::QuitUser(User* user, const std::string& quitreason, const std:
                ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Nick not found in clientlist, cannot remove: " + user->nick);
 
        uuidlist->erase(user->uuid);
+       user->PurgeEmptyChannels();
 }
 
 void UserManager::AddLocalClone(User *user)
index 32ae873890d0cb6b594fdfd13432997497f37d66..2458e156530eacd881d4df8a63523eaf6a7e893a 100644 (file)
@@ -325,7 +325,6 @@ CullResult User::cull()
 {
        if (!quitting)
                ServerInstance->Users->QuitUser(this, "Culled without QuitUser");
-       PurgeEmptyChannels();
 
        if (client_sa.sa.sa_family != AF_UNSPEC)
                ServerInstance->Users->RemoveCloneCounts(this);
@@ -974,7 +973,7 @@ void User::WriteCommonRaw(const std::string &line, bool include_self)
                for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
                {
                        LocalUser* u = IS_LOCAL(i->first);
-                       if (u && !u->quitting && u->already_sent != LocalUser::already_sent_id)
+                       if (u && u->already_sent != LocalUser::already_sent_id)
                        {
                                u->already_sent = LocalUser::already_sent_id;
                                u->Write(line);
@@ -1014,7 +1013,7 @@ void User::WriteCommonQuit(const std::string &normal_text, const std::string &op
                for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
                {
                        LocalUser* u = IS_LOCAL(i->first);
-                       if (u && !u->quitting && (u->already_sent != uniq_id))
+                       if (u && (u->already_sent != uniq_id))
                        {
                                u->already_sent = uniq_id;
                                u->Write(u->IsOper() ? operMessage : normalMessage);