diff options
Diffstat (limited to 'src/modules/m_dccallow.cpp')
-rw-r--r-- | src/modules/m_dccallow.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 8c2a5f73e..0c1c5a185 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -274,7 +274,9 @@ class ModuleDCCAllow : public Module // remove their DCCALLOW list if they have one if (udl) { - RemoveFromUserlist(user); + userlist::iterator it = std::find(ul.begin(), ul.end(), user); + if (it != ul.end()) + ul.erase(it); } // remove them from any DCCALLOW lists @@ -381,7 +383,7 @@ class ModuleDCCAllow : public Module void Expire() { - for (userlist::iterator iter = ul.begin(); iter != ul.end(); ++iter) + for (userlist::iterator iter = ul.begin(); iter != ul.end();) { User* u = (User*)(*iter); dl = ext->get(u); @@ -403,10 +405,11 @@ class ModuleDCCAllow : public Module } } } + ++iter; } else { - RemoveFromUserlist(u); + iter = ul.erase(iter); } } } @@ -414,7 +417,7 @@ class ModuleDCCAllow : public Module void RemoveNick(User* user) { /* Iterate through all DCCALLOW lists and remove user */ - for (userlist::iterator iter = ul.begin(); iter != ul.end(); ++iter) + for (userlist::iterator iter = ul.begin(); iter != ul.end();) { User *u = (User*)(*iter); dl = ext->get(u); @@ -434,10 +437,11 @@ class ModuleDCCAllow : public Module } } } + ++iter; } else { - RemoveFromUserlist(u); + iter = ul.erase(iter); } } } |