diff options
author | Adam <Adam@anope.org> | 2010-10-08 16:21:23 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-10-08 16:21:23 -0400 |
commit | b3dd5668f6679d2807e2598a0b0c42985e5736d2 (patch) | |
tree | f314446cde525b00a414dddd50273adfa9229938 /modules/core/cs_set_persist.cpp | |
parent | 63b1f9ce880cd06fdb5cddea85cb9a4cf293ab6f (diff) |
Set +P on mlock when channels are set as persistant
Diffstat (limited to 'modules/core/cs_set_persist.cpp')
-rw-r--r-- | modules/core/cs_set_persist.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
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 |