]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_clearchan.cpp
Merge pull request #976 from SaberUK/master+fix-xline-db
[user/henk/code/inspircd.git] / src / modules / m_clearchan.cpp
index 27f8ec32f7584d1e322419d0c284e7b381144d5c..5fcec36f1777d9567a7dc8d9b9d2a41fe97d665d 100644 (file)
@@ -93,10 +93,11 @@ class CommandClearChan : public Command
 
                std::string mask;
                // Now remove all local non-opers from the channel
-               const UserMembList* users = chan->GetUsers();
-               for (UserMembCIter i = users->begin(); i != users->end(); )
+               Channel::MemberMap& users = chan->userlist;
+               for (Channel::MemberMap::iterator i = users.begin(); i != users.end(); )
                {
                        User* curr = i->first;
+                       const Channel::MemberMap::iterator currit = i;
                        ++i;
 
                        if (!IS_LOCAL(curr) || curr->IsOper())
@@ -105,7 +106,7 @@ class CommandClearChan : public Command
                        // If kicking users, remove them and skip the QuitUser()
                        if (kick)
                        {
-                               chan->KickUser(ServerInstance->FakeClient, curr, reason);
+                               chan->KickUser(ServerInstance->FakeClient, currit, reason);
                                continue;
                        }
 
@@ -169,8 +170,8 @@ class ModuleClearChan : public Module
                        }
                }
 
-               const UserMembList* users = cmd.activechan->GetUsers();
-               for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+               const Channel::MemberMap& users = cmd.activechan->GetUsers();
+               for (Channel::MemberMap::const_iterator i = users.begin(); i != users.end(); ++i)
                {
                        LocalUser* curr = IS_LOCAL(i->first);
                        if (!curr)
@@ -199,8 +200,8 @@ class ModuleClearChan : public Module
        {
                // Hide the KICK from all non-opers
                User* leaving = memb->user;
-               const UserMembList* users = memb->chan->GetUsers();
-               for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+               const Channel::MemberMap& users = memb->chan->GetUsers();
+               for (Channel::MemberMap::const_iterator i = users.begin(); i != users.end(); ++i)
                {
                        User* curr = i->first;
                        if ((IS_LOCAL(curr)) && (!curr->IsOper()) && (curr != leaving))