summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mode.h2
-rw-r--r--include/modes/cmode_s.h8
-rw-r--r--src/mode.cpp5
-rw-r--r--src/modes/cmode_s.cpp20
4 files changed, 23 insertions, 12 deletions
diff --git a/include/mode.h b/include/mode.h
index d09d62439..65b55a285 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -112,6 +112,8 @@ class ModeParser
char* Grant(userrec *d,chanrec *chan,int MASK);
char* Revoke(userrec *d,chanrec *chan,int MASK);
public:
+ ModeParser();
+
void Process(char **parameters, int pcnt, userrec *user, bool servermode);
std::string CompressModes(std::string modes,bool channelmodes);
diff --git a/include/modes/cmode_s.h b/include/modes/cmode_s.h
new file mode 100644
index 000000000..981bddfaf
--- /dev/null
+++ b/include/modes/cmode_s.h
@@ -0,0 +1,8 @@
+#include "mode.h"
+
+class ModeChannelSecret : public ModeHandler
+{
+ public:
+ ModeChannelSecret();
+ ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
+};
diff --git a/src/mode.cpp b/src/mode.cpp
index d2ecbf369..ace7d1286 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1749,3 +1749,8 @@ void ModeParser::ServerMode(char **parameters, int pcnt, userrec *user)
WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
}
}
+
+ModeParser::ModeParser()
+{
+ cmode_s = new ModeChannelSecret();
+}
diff --git a/src/modes/cmode_s.cpp b/src/modes/cmode_s.cpp
index 16c446eec..6a27dddfd 100644
--- a/src/modes/cmode_s.cpp
+++ b/src/modes/cmode_s.cpp
@@ -2,18 +2,14 @@
#include "mode.h"
#include "channels.h"
#include "users.h"
+#include "modes/cmode_s.h"
-class ModeChannelSecret : public ModeHandler
+ModeChannelSecret::ModeChannelSecret() : ModeHandler('s', 0, 0, 0, MODETYPE_CHANNEL, false)
{
- public:
- ModeChannelSecret() : ModeHandler('s', 0, 0, 0, MODETYPE_CHANNEL, false)
- {
- }
-
- ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
- {
- channel->modes[CM_SECRET] = adding;
- return MODEACTION_ALLOW;
- }
-};
+}
+ModeAction ModeChannelSecret::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+{
+ channel->modes[CM_SECRET] = adding;
+ return MODEACTION_ALLOW;
+}