summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-08-06 13:27:16 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-08-06 13:27:16 +0200
commit00660293338f6a78278e52d05f6cf9a7ef9acc64 (patch)
treec26615335ba31d725a6edb8ae5814ef0157fa116
parent3e2cfaf8c0cda738033a877b3220cd9536601a2f (diff)
Remove a bunch of useless classes representing simple core modes
-rw-r--r--include/builtinmodes.h70
-rw-r--r--src/mode.cpp25
2 files changed, 18 insertions, 77 deletions
diff --git a/include/builtinmodes.h b/include/builtinmodes.h
index e78e68b11..26e38204a 100644
--- a/include/builtinmodes.h
+++ b/include/builtinmodes.h
@@ -35,16 +35,6 @@ class ModeChannelBan : public ListModeBase
}
};
-/** Channel mode +i
- */
-class ModeChannelInviteOnly : public SimpleChannelModeHandler
-{
- public:
- ModeChannelInviteOnly() : SimpleChannelModeHandler(NULL, "inviteonly", 'i')
- {
- }
-};
-
/** Channel mode +k
*/
class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
@@ -67,26 +57,6 @@ class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
ModeAction OnSet(User* source, Channel* channel, std::string& parameter);
};
-/** Channel mode +m
- */
-class ModeChannelModerated : public SimpleChannelModeHandler
-{
- public:
- ModeChannelModerated() : SimpleChannelModeHandler(NULL, "moderated", 'm')
- {
- }
-};
-
-/** Channel mode +n
- */
-class ModeChannelNoExternal : public SimpleChannelModeHandler
-{
- public:
- ModeChannelNoExternal() : SimpleChannelModeHandler(NULL, "noextmsg", 'n')
- {
- }
-};
-
/** Channel mode +o
*/
class ModeChannelOp : public PrefixMode
@@ -95,36 +65,6 @@ class ModeChannelOp : public PrefixMode
ModeChannelOp();
};
-/** Channel mode +p
- */
-class ModeChannelPrivate : public SimpleChannelModeHandler
-{
- public:
- ModeChannelPrivate() : SimpleChannelModeHandler(NULL, "private", 'p')
- {
- }
-};
-
-/** Channel mode +s
- */
-class ModeChannelSecret : public SimpleChannelModeHandler
-{
- public:
- ModeChannelSecret() : SimpleChannelModeHandler(NULL, "secret", 's')
- {
- }
-};
-
-/** Channel mode +t
- */
-class ModeChannelTopicOps : public SimpleChannelModeHandler
-{
- public:
- ModeChannelTopicOps() : SimpleChannelModeHandler(NULL, "topiclock", 't')
- {
- }
-};
-
/** Channel mode +v
*/
class ModeChannelVoice : public PrefixMode
@@ -133,16 +73,6 @@ class ModeChannelVoice : public PrefixMode
ModeChannelVoice();
};
-/** User mode +i
- */
-class ModeUserInvisible : public SimpleUserModeHandler
-{
- public:
- ModeUserInvisible() : SimpleUserModeHandler(NULL, "invisible", 'i')
- {
- }
-};
-
/** User mode +s
*/
class ModeUserServerNoticeMask : public ModeHandler
diff --git a/src/mode.cpp b/src/mode.cpp
index 7deeb9b32..bd7adbd65 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -925,13 +925,13 @@ void PrefixMode::RemoveMode(Channel* chan, irc::modestacker& stack)
struct builtin_modes
{
- ModeChannelSecret s;
- ModeChannelPrivate p;
- ModeChannelModerated m;
- ModeChannelTopicOps t;
+ SimpleChannelModeHandler s;
+ SimpleChannelModeHandler p;
+ SimpleChannelModeHandler m;
+ SimpleChannelModeHandler t;
- ModeChannelNoExternal n;
- ModeChannelInviteOnly i;
+ SimpleChannelModeHandler n;
+ SimpleChannelModeHandler i;
ModeChannelKey k;
ModeChannelLimit l;
@@ -939,10 +939,21 @@ struct builtin_modes
ModeChannelOp o;
ModeChannelVoice v;
- ModeUserInvisible ui;
+ SimpleUserModeHandler ui;
ModeUserOperator uo;
ModeUserServerNoticeMask us;
+ builtin_modes()
+ : s(NULL, "secret", 's')
+ , p(NULL, "private", 'p')
+ , m(NULL, "moderated", 'm')
+ , t(NULL, "topiclock", 't')
+ , n(NULL, "noextmsg", 'n')
+ , i(NULL, "inviteonly", 'i')
+ , ui(NULL, "invisible", 'i')
+ {
+ }
+
void init()
{
ServiceProvider* modes[] = { &s, &p, &m, &t, &n, &i, &k, &l, &b, &o, &v,