X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fbuiltinmodes.h;h=62ccaf62d18dd95fd9c2b42983fffdc09892722a;hb=4fc2f7199e964ba5112ecdb2613c6fd5c2eee638;hp=ce73a78171c374cbf3c4f44ee72f2ff7deb63200;hpb=34fa5627de0a0431ca76f34445c680a76a9a7dc5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/builtinmodes.h b/include/builtinmodes.h index ce73a7817..62ccaf62d 100644 --- a/include/builtinmodes.h +++ b/include/builtinmodes.h @@ -35,53 +35,27 @@ class ModeChannelBan : public ListModeBase } }; -/** Channel mode +i - */ -class ModeChannelInviteOnly : public SimpleChannelModeHandler -{ - public: - ModeChannelInviteOnly() : SimpleChannelModeHandler(NULL, "inviteonly", 'i') - { - } -}; - /** Channel mode +k */ -class ModeChannelKey : public ModeHandler +class ModeChannelKey : public ParamMode { + static const std::string::size_type maxkeylen = 32; public: ModeChannelKey(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + void SerializeParam(Channel* chan, const std::string* key, std::string& out); + ModeAction OnSet(User* source, Channel* chan, std::string& param); }; /** Channel mode +l */ -class ModeChannelLimit : public ParamChannelModeHandler +class ModeChannelLimit : public ParamMode { public: ModeChannelLimit(); - bool ParamValidate(std::string& parameter); bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel); -}; - -/** 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') - { - } + void SerializeParam(Channel* chan, intptr_t n, std::string& out); + ModeAction OnSet(User* source, Channel* channel, std::string& parameter); }; /** Channel mode +o @@ -89,36 +63,10 @@ class ModeChannelNoExternal : public SimpleChannelModeHandler class ModeChannelOp : public PrefixMode { public: - 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') + ModeChannelOp() + : PrefixMode(NULL, "op", 'o', OP_VALUE, '@') { + levelrequired = OP_VALUE; } }; @@ -127,16 +75,10 @@ class ModeChannelTopicOps : public SimpleChannelModeHandler class ModeChannelVoice : public PrefixMode { public: - ModeChannelVoice(); -}; - -/** User mode +i - */ -class ModeUserInvisible : public SimpleUserModeHandler -{ - public: - ModeUserInvisible() : SimpleUserModeHandler(NULL, "invisible", 'i') + ModeChannelVoice() + : PrefixMode(NULL, "voice", 'v', VOICE_VALUE, '+') { + levelrequired = HALFOP_VALUE; } }; @@ -173,13 +115,3 @@ class ModeUserOperator : public ModeHandler ModeUserOperator(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; - -/** User mode +w - */ -class ModeUserWallops : public SimpleUserModeHandler -{ - public: - ModeUserWallops() : SimpleUserModeHandler(NULL, "wallops", 'w') - { - } -};