diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mode.h | 2 | ||||
-rw-r--r-- | include/modes/cmode_h.h | 1 | ||||
-rw-r--r-- | include/modes/cmode_k.h | 1 | ||||
-rw-r--r-- | include/modes/cmode_l.h | 1 | ||||
-rw-r--r-- | include/modes/cmode_o.h | 1 | ||||
-rw-r--r-- | include/modes/cmode_v.h | 1 | ||||
-rw-r--r-- | include/u_listmode.h | 17 |
7 files changed, 24 insertions, 0 deletions
diff --git a/include/mode.h b/include/mode.h index 76389c6a4..ce1c085ac 100644 --- a/include/mode.h +++ b/include/mode.h @@ -181,6 +181,8 @@ class ModeHandler : public Extensible * @return True if the other side wins the merge, false if we win the merge for this mode. */ virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); + + virtual std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); }; /** diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h index 1cec864d1..963052180 100644 --- a/include/modes/cmode_h.h +++ b/include/modes/cmode_h.h @@ -9,5 +9,6 @@ class ModeChannelHalfOp : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddHalfOp(userrec *user,const char *dest,chanrec *chan,int status); std::string DelHalfOp(userrec *user,const char *dest,chanrec *chan,int status); + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index f855afee9..bcb67b945 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -5,4 +5,5 @@ class ModeChannelKey : public ModeHandler public: 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); }; diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h index d13bd0459..3eb332c7f 100644 --- a/include/modes/cmode_l.h +++ b/include/modes/cmode_l.h @@ -5,4 +5,5 @@ class ModeChannelLimit : public ModeHandler public: 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); }; diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h index cf223b97f..ad34f501c 100644 --- a/include/modes/cmode_o.h +++ b/include/modes/cmode_o.h @@ -9,5 +9,6 @@ class ModeChannelOp : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddOp(userrec *user,const char *dest,chanrec *chan,int status); std::string DelOp(userrec *user,const char *dest,chanrec *chan,int status); + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); }; diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h index 8cf1ad994..f61f183c5 100644 --- a/include/modes/cmode_v.h +++ b/include/modes/cmode_v.h @@ -9,5 +9,6 @@ class ModeChannelVoice : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddVoice(userrec *user,const char *dest,chanrec *chan,int status); std::string DelVoice(userrec *user,const char *dest,chanrec *chan,int status); + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); }; diff --git a/include/u_listmode.h b/include/u_listmode.h index 036319b9e..c7568897f 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -64,6 +64,23 @@ class ListModeBase : public ModeHandler infokey = "exceptionbase_mode_" + std::string(1, mode) + "_list"; } + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + { + modelist* el; + channel->GetExt(infokey, el); + if (el) + { + for (modelist::iterator it = el->begin(); it != el->end(); it++) + { + if(parameter == it->mask) + { + return std::make_pair(true, parameter); + } + } + } + return std::make_pair(false, parameter); + } + virtual void DisplayList(userrec* user, chanrec* channel) { modelist* el; |