X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fbuiltinmodes.h;h=ce73a78171c374cbf3c4f44ee72f2ff7deb63200;hb=cc74fb0be4ce4a5f55719dcf4b1045fe156ded1b;hp=ba34a3da9d720e5f6e25c7b0e894525c368df6e4;hpb=3406c7234ac15b6a2fc52afa770fb851da25c215;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/builtinmodes.h b/include/builtinmodes.h index ba34a3da9..ce73a7817 100644 --- a/include/builtinmodes.h +++ b/include/builtinmodes.h @@ -86,13 +86,10 @@ class ModeChannelNoExternal : public SimpleChannelModeHandler /** Channel mode +o */ -class ModeChannelOp : public ModeHandler +class ModeChannelOp : public PrefixMode { - private: public: ModeChannelOp(); - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); - unsigned int GetPrefixRank(); }; /** Channel mode +p @@ -127,13 +124,10 @@ class ModeChannelTopicOps : public SimpleChannelModeHandler /** Channel mode +v */ -class ModeChannelVoice : public ModeHandler +class ModeChannelVoice : public PrefixMode { - private: public: ModeChannelVoice(); - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); - unsigned int GetPrefixRank(); }; /** User mode +i @@ -146,14 +140,28 @@ class ModeUserInvisible : public SimpleUserModeHandler } }; -/** User mode +n +/** User mode +s */ class ModeUserServerNoticeMask : public ModeHandler { + /** Process a snomask modifier string, e.g. +abc-de + * @param user The target user + * @param input A sequence of notice mask characters + * @return The cleaned mode sequence which can be output, + * e.g. in the above example if masks c and e are not + * valid, this function will return +ab-d + */ + std::string ProcessNoticeMasks(User* user, const std::string& input); + public: ModeUserServerNoticeMask(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); void OnParameterMissing(User* user, User* dest, Channel* channel); + + /** Create a displayable mode string of the snomasks set on a given user + * @param user The user whose notice masks to format + * @return The notice mask character sequence + */ std::string GetUserParameter(User* user); };