diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-09 02:58:43 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-09 02:58:43 +0000 |
commit | d3472e07a113dff34c2d9283c83ffff3fb570f78 (patch) | |
tree | 95fe4b1103c4ef36bb192ca8b4291fc9860f27ff | |
parent | 190815df670ff34c08b3f4c50bd6758b3338e8e3 (diff) |
Revert repeat timer to old one, to make sure it only runs if list was actually being called by a user.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6277 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_safelist.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index b3ade5434..7441f0ea5 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -39,6 +39,8 @@ UserList listusers; /* vector of people doing a /list */ class ListTimer *timer; /** To create a timer which recurs every second, we inherit from InspTimer. + * InspTimer is only one-shot however, so at the end of each Tick() we simply + * insert another of ourselves into the pending queue :) */ class ListTimer : public InspTimer { @@ -52,7 +54,7 @@ class ListTimer : public InspTimer public: - ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,Instance->Time(), true), ServerInstance(Instance) + ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,Instance->Time()), ServerInstance(Instance) { ServerNameSize = 4 + strlen(ServerInstance->Config->ServerName); } @@ -141,7 +143,12 @@ class ListTimer : public InspTimer } } - if (!listusers.size()) + if (listusers.size()) + { + timer = new ListTimer(ServerInstance,1); + ServerInstance->Timers->AddTimer(timer); + } + else { timer = NULL; } |