From b3dd5668f6679d2807e2598a0b0c42985e5736d2 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 8 Oct 2010 16:21:23 -0400 Subject: Set +P on mlock when channels are set as persistant --- modules/core/cs_set_persist.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp index 508ff1cd5..bee71f95e 100644 --- a/modules/core/cs_set_persist.cpp +++ b/modules/core/cs_set_persist.cpp @@ -56,8 +56,13 @@ class CommandCSSetPersist : public Command } /* Set the perm mode */ - if (cm && ci->c && !ci->c->HasMode(CMODE_PERM)) - ci->c->SetMode(NULL, cm); + if (cm) + { + if (ci->c && !ci->c->HasMode(CMODE_PERM)) + ci->c->SetMode(NULL, cm); + /* Add it to the channels mlock */ + ci->SetMLock(CMODE_PERM, true); + } } u->SendMessage(ChanServ, CHAN_SET_PERSIST_ON, ci->name.c_str()); @@ -71,8 +76,13 @@ class CommandCSSetPersist : public Command ci->c->UnsetFlag(CH_PERSIST); /* Unset perm mode */ - if (cm && ci->c && ci->c->HasMode(CMODE_PERM)) - ci->c->RemoveMode(NULL, cm); + if (cm) + { + if (ci->c && ci->c->HasMode(CMODE_PERM)) + ci->c->RemoveMode(NULL, cm); + /* Remove from mlock */ + ci->RemoveMLock(CMODE_PERM); + } /* No channel mode, no BotServ, but using ChanServ as the botserv bot * which was assigned when persist was set on -- cgit