From 2b2c61df8e55a331768d54cdef738c4c5179ca10 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 May 2007 21:45:16 +0000 Subject: Add and git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6969 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_watch.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/modules/m_watch.cpp') diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 170585737..b46d80b54 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -303,14 +303,23 @@ class Modulewatch : public Module Modulewatch(InspIRCd* Me) : Module::Module(Me), maxwatch(32) { + OnRehash(NULL, ""); whos_watching_me = new watchentries(); mycommand = new cmd_watch(ServerInstance, maxwatch); ServerInstance->AddCommand(mycommand); } + virtual void OnRehash(userrec* user, const std::string ¶meter) + { + ConfigReader Conf(ServerInstance); + maxwatch = Conf.ReadInteger("watch", "maxentries", 0, true); + if (!maxwatch) + maxwatch = 32; + } + void Implements(char* List) { - List[I_OnGarbageCollect] = List[I_OnCleanup] = List[I_OnUserQuit] = List[I_OnPostConnect] = List[I_OnUserPostNick] = List[I_On005Numeric] = 1; + List[I_OnRehash] = List[I_OnGarbageCollect] = List[I_OnCleanup] = List[I_OnUserQuit] = List[I_OnPostConnect] = List[I_OnUserPostNick] = List[I_On005Numeric] = 1; } virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message) @@ -437,7 +446,7 @@ class Modulewatch : public Module virtual void On005Numeric(std::string &output) { // we don't really have a limit... - output = output + " WATCH=32"; + output = output + " WATCH=" + ConvToStr(maxwatch); } virtual ~Modulewatch() -- cgit v1.3.1-10-gc9f91