summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mode.h15
-rw-r--r--src/mode.cpp20
2 files changed, 5 insertions, 30 deletions
diff --git a/include/mode.h b/include/mode.h
index cfac562e6..e692c5345 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -45,17 +45,6 @@ enum ModeAction {
MODEACTION_ALLOW = 1 /* Allow the mode */
};
-class ModeOutput
-{
- private:
- std::string par;
- ModeAction act;
- public:
- ModeOutput(std::string parameter, ModeAction action);
- ModeAction GetAction();
- std::string& GetParameter();
-};
-
class ModeHandler
{
char mode;
@@ -74,7 +63,7 @@ class ModeHandler
int GetNumParams();
char GetModeChar();
- virtual ModeOutput OnModeChange(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding);
+ virtual ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding); /* Can change the mode parameter as its a ref */
virtual void DisplayList(userrec* user, chanrec* channel);
virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel);
};
@@ -91,7 +80,7 @@ class ModeWatcher
char GetModeChar();
ModeType GetModeType();
- virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding);
+ virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding); /* Can change the mode parameter */
virtual void AfterMode(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding);
};
diff --git a/src/mode.cpp b/src/mode.cpp
index d61725eef..7433f4756 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -54,20 +54,6 @@ extern ServerConfig* Config;
extern time_t TIME;
-ModeOutput::ModeOutput(std::string parameter, ModeAction action) : par(parameter), act(action)
-{
-}
-
-ModeAction ModeOutput::GetAction()
-{
- return act;
-}
-
-std::string& ModeOutput::GetParameter()
-{
- return par;
-}
-
ModeHandler::ModeHandler(char modeletter, int parameters, bool listmode, ModeType type, bool operonly) : mode(modeletter), n_params(parameters), list(listmode), m_type(type), oper(operonly)
{
}
@@ -101,9 +87,9 @@ char ModeHandler::GetModeChar()
return mode;
}
-ModeOutput ModeHandler::OnModeChange(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding)
+ModeAction ModeHandler::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
- return ModeOutput("", MODEACTION_DENY);
+ return MODEACTION_DENY;
}
void ModeHandler::DisplayList(userrec* user, chanrec* channel)
@@ -133,7 +119,7 @@ ModeType ModeWatcher::GetModeType()
return m_type;
}
-bool ModeWatcher::BeforeMode(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding)
+bool ModeWatcher::BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
return true;
}