diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mode.h | 19 | ||||
-rw-r--r-- | include/modes/cmode_k.h | 1 | ||||
-rw-r--r-- | include/modes/cmode_l.h | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/mode.h b/include/mode.h index b248dfb3e..6e2f03788 100644 --- a/include/mode.h +++ b/include/mode.h @@ -182,6 +182,19 @@ class ModeHandler : public Extensible */ virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); + /** + * When a remote server needs to bounce a set of modes, it will call this method for every mode + * in the mode string to determine if the mode is set or not. + * @param source of the mode change, this will be NULL for a server mode + * @param dest Target user of the mode change, if this is a user mode + * @param channel Target channel of the mode change, if this is a channel mode + * @param parameter The parameter given for the mode change, or an empty string + * @returns The first value of the pair should be true if the mode is set with the given parameter. + * In the case of permissions modes such as channelmode +o, this should return true if the user given + * as the parameter has the given privilage on the given channel. The string value of the pair will hold + * the current setting for this mode set locally, when the bool is true, or, the parameter given. + * This allows the local server to enforce our locally set parameters back to a remote server. + */ virtual std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); }; @@ -347,6 +360,12 @@ class ModeParser : public classbase */ void Process(const char** parameters, int pcnt, userrec *user, bool servermode); + /** + * Find the mode handler for a given mode and type + * @param modeletter mode letter to search for + * @param type of mode to search for, user or channel + * @returns a pointer to a ModeHandler class, or NULL of there isnt a handler for the given mode + */ ModeHandler* FindMode(unsigned const char modeletter, ModeType mt); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index bcb67b945..94a317df0 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -6,4 +6,5 @@ class ModeChannelKey : public ModeHandler ModeChannelKey(); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); }; diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h index 3eb332c7f..886ece324 100644 --- a/include/modes/cmode_l.h +++ b/include/modes/cmode_l.h @@ -6,4 +6,5 @@ class ModeChannelLimit : public ModeHandler ModeChannelLimit(); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); }; |