summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-05 15:43:28 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-05 15:43:28 +0000
commit9336468f5bfa60318cb57db5126047147b7a21cb (patch)
treefa21c838f2c706463ed25305d351397d9d5ced47 /src/mode.cpp
parent98b252507021cd63ac8e6fd92185325562eb3575 (diff)
Run DelMode and DelModeWatcher in RemoveModule
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11799 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 73b465917..845473c95 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -50,8 +50,8 @@
#include "modes/umode_s.h"
ModeHandler::ModeHandler(Module* Creator, char modeletter, ParamSpec Params, ModeType type)
- : mode(modeletter), parameters_taken(Params), list(false), m_type(type), m_paramtype(TR_TEXT),
- oper(false), prefix(0), count(0), levelrequired(HALFOP_VALUE), creator(Creator)
+ : m_paramtype(TR_TEXT), parameters_taken(Params), mode(modeletter), prefix(0), oper(false),
+ list(false), m_type(type), count(0), levelrequired(HALFOP_VALUE), creator(Creator)
{
}
@@ -188,7 +188,8 @@ ModeAction SimpleChannelModeHandler::OnModeChange(User* source, User* dest, Chan
return MODEACTION_DENY;
}
-ModeWatcher::ModeWatcher(char modeletter, ModeType type) : mode(modeletter), m_type(type)
+ModeWatcher::ModeWatcher(Module* Creator, char modeletter, ModeType type)
+ : mode(modeletter), m_type(type), creator(Creator)
{
}
@@ -683,6 +684,22 @@ bool ModeParser::DelMode(ModeHandler* mh)
return true;
}
+void ModeParser::RemoveModes(Module* mod)
+{
+ for(int i=0; i < 256; i++)
+ {
+ ModeHandler* mh = modehandlers[i];
+ if (mh && mh->creator == mod)
+ DelMode(mh);
+ for(unsigned int j=0; j < modewatchers[i].size(); j++)
+ {
+ ModeWatcher* mw = modewatchers[i][j];
+ if (mw && mw->creator == mod)
+ DelModeWatcher(mw);
+ }
+ }
+}
+
ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt)
{
unsigned char mask = 0;