diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 9db73decf..d32669701 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -523,7 +523,7 @@ class CommandCSSetPersist : public Command /* Add it to the channels mlock */ ModeLocks *ml = ci->Require("modelocks"); if (ml) - ml->SetMLock(cm, true); + ml->SetMLock(cm, true, "", source.GetNick()); } /* No botserv bot, no channel mode, give them ChanServ. * Yes, this works fine with no BotServ. diff --git a/src/modes.cpp b/src/modes.cpp index 55ce2b506..d82b367dc 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -570,14 +570,30 @@ void ModeManager::ProcessModes() } } +template +static void StackerDel(std::map &map, T *obj) +{ + typename std::map::iterator it = map.find(obj); + if (it != map.end()) + { + StackerInfo *si = it->second; + std::list ModeStrings = BuildModeStrings(si); + for (std::list::iterator lit = ModeStrings.begin(), lit_end = ModeStrings.end(); lit != lit_end; ++lit) + IRCD->SendMode(si->bi, obj, lit->c_str()); + + delete si; + map.erase(it); + } +} + void ModeManager::StackerDel(User *u) { - UserStackerObjects.erase(u); + ::StackerDel(UserStackerObjects, u); } void ModeManager::StackerDel(Channel *c) { - ChannelStackerObjects.erase(c); + ::StackerDel(ChannelStackerObjects, c); } void ModeManager::StackerDel(Mode *m)