X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fbuiltinmodes.h;h=b1e5c3ccd10bd87005b96eefcfcba902cd699267;hb=abc57eddfb56462ac3e433601d010abf1942e611;hp=a4a9509221ad0bac156b4df04a145e64dc160f66;hpb=8790551dc182cd8804ee7d8ef89ccb31067cc2a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/builtinmodes.h b/include/builtinmodes.h index a4a950922..b1e5c3ccd 100644 --- a/include/builtinmodes.h +++ b/include/builtinmodes.h @@ -52,11 +52,8 @@ class ModeChannelKey : public ModeHandler public: ModeChannelKey(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); - void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); - void RemoveMode(User* user, irc::modestacker* stack = NULL); }; - /** Channel mode +l */ class ModeChannelLimit : public ParamChannelModeHandler @@ -96,8 +93,6 @@ class ModeChannelOp : public ModeHandler ModeChannelOp(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetPrefixRank(); - void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); - void RemoveMode(User* user, irc::modestacker* stack = NULL); }; /** Channel mode +p @@ -139,8 +134,6 @@ class ModeChannelVoice : public ModeHandler ModeChannelVoice(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetPrefixRank(); - void RemoveMode(User* user, irc::modestacker* stack = NULL); - void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); }; /** User mode +i @@ -153,14 +146,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); };