X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmode.h;h=9b8d07877d2a98bbe55ac016cadf737f71e86aa1;hb=3624c137a6db85eaab0372550c9dca79d6d21e55;hp=3805b174bc3c56120b87db33e6c8fbacd69c1e08;hpb=b390ded3f3924cbd16a5dab53a981be279360124;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/mode.h b/include/mode.h index 3805b174b..9b8d07877 100644 --- a/include/mode.h +++ b/include/mode.h @@ -471,6 +471,29 @@ class CoreExport ModeParser std::string Cached004ModeList; public: + typedef unsigned int ModeProcessFlag; + enum ModeProcessFlags + { + /** If only this flag is specified, the mode change will be global + * and parameter modes will have their parameters explicitly set + * (not merged). This is the default. + */ + MODE_NONE = 0, + + /** If this flag is set then the parameters of non-listmodes will be + * merged according to their conflict resolution rules. + * Does not affect user modes, channel modes without a parameter and + * listmodes. + */ + MODE_MERGE = 1, + + /** If this flag is set then the mode change won't be handed over to + * the linking module to be sent to other servers, but will be processed + * locally and sent to local user(s) as usual. + */ + MODE_LOCALONLY = 2 + }; + ModeParser(); ~ModeParser(); @@ -533,12 +556,11 @@ class CoreExport ModeParser /** Process a set of mode changes from a server or user. * @param parameters The parameters of the mode change, in the format * they would be from a MODE command. - * @param user The user setting or removing the modes. When the modes are set - * by a server, an 'uninitialized' User is used, where *user\::nick == NULL - * and *user->server == NULL. - * @param merge Should the mode parameters be merged? + * @param user The source of the mode change, can be a server user. + * @param flags Optional flags controlling how the mode change is processed, + * defaults to MODE_NONE. */ - void Process(const std::vector& parameters, User *user, bool merge = false); + void Process(const std::vector& parameters, User* user, ModeProcessFlag flags = MODE_NONE); /** Find the mode handler for a given mode and type. * @param modeletter mode letter to search for