diff options
author | Adam <Adam@anope.org> | 2010-08-15 17:15:15 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-08-15 17:15:15 -0400 |
commit | de8eeab2d9ebba0910706e91fe9fa656bdf8583b (patch) | |
tree | 7cc8bb73a85e56d7d299e6c46c974ea4be4be3d6 /modules/core/cs_set_persist.cpp | |
parent | c2a97d9f3f2d56d889875f9b60d1e2cbc9826d15 (diff) |
Fixed persist to work correctly with the new bot tracking system
Diffstat (limited to 'modules/core/cs_set_persist.cpp')
-rw-r--r-- | modules/core/cs_set_persist.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp index 4b650327d..076cca95b 100644 --- a/modules/core/cs_set_persist.cpp +++ b/modules/core/cs_set_persist.cpp @@ -34,7 +34,7 @@ class CommandCSSetPersist : public Command { ci->SetFlag(CI_PERSIST); - /* Channel doesn't exist, create it internally */ + /* Channel doesn't exist, create it */ if (!ci->c) { Channel *c = new Channel(ci->name); @@ -47,7 +47,11 @@ class CommandCSSetPersist : public Command * Yes, this works fine with no Config.s_BotServ */ if (!ci->bi && !cm) + { ChanServ->Assign(NULL, ci); + if (!ci->c->FindUser(ChanServ)) + ChanServ->Join(ci->c); + } /* Set the perm mode */ if (cm && ci->c && !ci->c->HasMode(CMODE_PERM)) @@ -65,8 +69,6 @@ class CommandCSSetPersist : public Command /* Unset perm mode */ if (cm && ci->c && ci->c->HasMode(CMODE_PERM)) ci->c->RemoveMode(NULL, cm); - if (!Config.s_BotServ.empty() && ci->bi && ci->c->FindUser(ci->bi)) - ci->bi->Part(ci->c); /* No channel mode, no BotServ, but using ChanServ as the botserv bot * which was assigned when persist was set on @@ -74,9 +76,6 @@ class CommandCSSetPersist : public Command if (!cm && Config.s_BotServ.empty() && ci->bi) /* Unassign bot */ ChanServ->UnAssign(NULL, ci); - - if (ci->c && ci->c->users.empty()) - delete ci->c; } notice_lang(Config.s_ChanServ, u, CHAN_SET_PERSIST_OFF, ci->name.c_str()); |