diff options
author | Adam <Adam@anope.org> | 2013-03-20 11:03:02 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-03-20 11:39:16 -0500 |
commit | 6a0e4418f4c41dfb687de80773b4e4d45dc2e12b (patch) | |
tree | f713464980b3c28b17d473e32eb7df612468d94b /modules/pseudoclients/botserv.cpp | |
parent | 731912f01eb14d811575c492dc64b60084bd412c (diff) |
Check that channels still exist before nulling their ci pointer in channelinfos destructor
Change the persist setting on a channel to mean only that it is being
enforced ircd-side
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
-rw-r--r-- | modules/pseudoclients/botserv.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 2c506876a..2f157b809 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -184,7 +184,7 @@ class BotServCore : public Module void OnLeaveChannel(User *u, Channel *c) anope_override { /* Channel is persistent, it shouldn't be deleted and the service bot should stay */ - if (c->HasExt("PERSIST") || (c->ci && c->ci->HasExt("PERSIST"))) + if (c->ci && c->ci->HasExt("PERSIST")) return; /* Channel is syncing from a netburst, don't destroy it as more users are probably wanting to join immediatly @@ -197,14 +197,9 @@ class BotServCore : public Module if (c->HasExt("INHABIT")) return; + /* This is called prior to removing the user from the channnel, so c->users.size() - 1 should be safe */ if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->BSMinUsers && c->FindUser(c->ci->bi)) - { - bool persist = c->Shrink("PERSIST"); - c->Extend("PERSIST"); c->ci->bi->Part(c->ci->c); - if (!persist) - c->Shrink("PERSIST"); - } } EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override |