diff options
Diffstat (limited to 'include/modes.h')
-rw-r--r-- | include/modes.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/modes.h b/include/modes.h index db84a64fe..3052ab00b 100644 --- a/include/modes.h +++ b/include/modes.h @@ -33,6 +33,20 @@ enum ModeClass MC_USER }; +struct ModeData final +{ + Anope::string value; + Anope::string set_by; + time_t set_at; + + ModeData(const Anope::string &v = "", const Anope::string &s = "", time_t t = 0) + : value(v) + , set_by(s) + , set_at(t) + { + } +}; + /** This class is the basis of all modes in Anope */ class CoreExport Mode @@ -311,6 +325,7 @@ public: class CoreExport ModeManager final { public: + using Change = std::multimap<Mode *, std::pair<bool, ModeData>>; /* Number of generic channel and user modes we are tracking */ static unsigned GenericChannelModes; @@ -378,18 +393,18 @@ public: * @param c The channel * @param cm The channel mode * @param set true for setting, false for removing - * @param param The param, if there is one + * @param data Data about the mode. */ - static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string ¶m = ""); + static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const ModeData &data = {}); /** Add a mode to the stacker to be set on a user * @param bi The client to set the modes from * @param u The user * @param um The user mode * @param set true for setting, false for removing - * @param param The param, if there is one + * @param data Data about the mode. */ - static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string ¶m = ""); + static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const ModeData &data = {}); /** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users */ |