summaryrefslogtreecommitdiff
path: root/src/modules/m_watch.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-10 21:45:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-10 21:45:16 +0000
commit2b2c61df8e55a331768d54cdef738c4c5179ca10 (patch)
tree1b72a3544aeed9eb3619c91ee7276487d2e5c0e6 /src/modules/m_watch.cpp
parent8cc3fd44a60de4b5dd8c46a9e50a7e18628579de (diff)
Add <watch maxentries> and <silence maxentries>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6969 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_watch.cpp')
-rw-r--r--src/modules/m_watch.cpp13
1 files changed, 11 insertions, 2 deletions
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 &parameter)
+ {
+ 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()