diff options
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 |