diff options
author | Adam <Adam@anope.org> | 2010-09-16 18:12:12 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-09-16 18:12:12 -0400 |
commit | cd1e9f3181234521a2858f73b47f57a22c0dad40 (patch) | |
tree | 2d2613af40ce3196d2149f9b614f363db088b802 /src | |
parent | ccc6109879617f4fc910bd78d395b9eee4300a2e (diff) |
Fixed Anope::CurTime to really work, and made ChanServ timers allow using the channels botserv bot instead of only ChanServ
Diffstat (limited to 'src')
-rw-r--r-- | src/chanserv.cpp | 13 | ||||
-rw-r--r-- | src/main.cpp | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 9d8fb411a..338d0f311 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -837,17 +837,22 @@ ChanServTimer::ChanServTimer(Channel *chan) : Timer(Config->CSInhabit), c(chan) { if (c->ci) c->ci->SetFlag(CI_INHABIT); - ChanServ->Join(c); + if (!c->ci->bi) + ChanServ->Join(*c); + else if (!c->FindUser(c->ci->bi)) + c->ci->bi->Join(*c); } void ChanServTimer::Tick(time_t) { - if (!c->ci) + if (!c || !c->ci) return; c->ci->UnsetFlag(CI_INHABIT); - if (c->users.size() == 1 || c->ci->bi != ChanServ) - ChanServ->Part(c); + if (!c->ci->bi) + ChanServ->Part(*c); + else if (c->users.size() == 1 || c->users.size() < Config->BSMinUsers) + c->ci->bi->Part(*c); } diff --git a/src/main.cpp b/src/main.cpp index 26ebd65ba..a1417b197 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,6 +71,8 @@ time_t start_time; /* Parameters and environment */ char **my_av, **my_envp; +time_t Anope::CurTime = time(NULL); + /******** Local variables! ********/ /* Set to 1 after we've set everything up */ |