/** The prefix rank required to unset this mode on channels. */
unsigned int ranktounset;
+ /** If non-empty then the syntax of the parameter for this mode. */
+ std::string syntax;
+
public:
/**
* The constructor for ModeHandler initalizes the mode handler.
return adding ? ranktoset : ranktounset;
}
+ /** Retrieves the syntax of the parameter for this mode. */
+ const std::string& GetSyntax() const { return syntax; }
+
friend class ModeParser;
};
class CoreExport ModeParser : public fakederef<ModeParser>
{
public:
+ /** The maximum number of modes which can be created. */
static const ModeHandler::Id MODEID_MAX = 64;
+ /** The maximum length of a mode parameter. */
+ static const size_t MODE_PARAM_MAX = 250;
+
/** Type of the container that maps mode names to ModeHandlers
*/
typedef TR1NS::unordered_map<std::string, ModeHandler*, irc::insensitive, irc::StrHashComp> ModeHandlerMap;
* @param user The source of the mode change, can be a server user.
* @param targetchannel Channel to apply the mode change on. NULL if changing modes on a channel.
* @param targetuser User to apply the mode change on. NULL if changing modes on a user.
- * @param changelist Modes to change in form of a Modes::ChangeList. May not process
+ * @param changelist Modes to change in form of a Modes::ChangeList. May not process
* the entire list due to MODE line length and max modes limitations.
* @param flags Optional flags controlling how the mode change is processed,
* defaults to MODE_NONE.
* is a channel mode change.
* @param parameters List of strings describing the mode change to convert to a ChangeList.
* Must be using the same format as the parameters of a MODE command.
- * @param changelist ChangeList object to populate.
- * @param beginindex Index of the first element that is part of the MODE list in the parameters
- * container. Defaults to 1.
- * @param endindex Index of the first element that is not part of the MODE list. By default,
- * the entire container is considered part of the MODE list.
+ * @param changelist ChangeList object to populate.
+ * @param beginindex Index of the first element that is part of the MODE list in the parameters
+ * container. Defaults to 1.
+ * @param endindex Index of the first element that is not part of the MODE list. By default,
+ * the entire container is considered part of the MODE list.
*/
void ModeParamsToChangeList(User* user, ModeType type, const std::vector<std::string>& parameters, Modes::ChangeList& changelist, unsigned int beginindex = 1, unsigned int endindex = UINT_MAX);