diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mode.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_b.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_h.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_k.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_o.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_v.h | 4 | ||||
-rw-r--r-- | include/u_listmode.h | 12 |
7 files changed, 21 insertions, 15 deletions
diff --git a/include/mode.h b/include/mode.h index ea52acf36..e15ddeeb0 100644 --- a/include/mode.h +++ b/include/mode.h @@ -276,7 +276,7 @@ class CoreExport ModeHandler : public Extensible * your mode properly from each user. * @param user The user which the server wants to remove your mode from */ - virtual void RemoveMode(User* user); + virtual void RemoveMode(User* user, irc::modestacker* stack = NULL); /** * When a MODETYPE_CHANNEL mode handler is being removed, the server will call this method for every channel on the server. @@ -286,7 +286,7 @@ class CoreExport ModeHandler : public Extensible * your mode properly from each channel. Note that in the case of listmodes, you should remove the entire list of items. * @param channel The channel which the server wants to remove your mode from */ - virtual void RemoveMode(Channel* channel); + virtual void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); char GetNeededPrefix(); diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h index fc5eb0892..bbeef1c62 100644 --- a/include/modes/cmode_b.h +++ b/include/modes/cmode_b.h @@ -30,7 +30,7 @@ class ModeChannelBan : public ModeHandler void DisplayList(User* user, Channel* channel); void DisplayEmptyList(User* user, Channel* channel); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); - void RemoveMode(User* user); - void RemoveMode(Channel* channel); + void RemoveMode(User* user, irc::modestacker* stack = NULL); + void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); }; diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h index c8ea793c0..9c72a1431 100644 --- a/include/modes/cmode_h.h +++ b/include/modes/cmode_h.h @@ -28,7 +28,7 @@ class ModeChannelHalfOp : public ModeHandler std::string DelHalfOp(User *user,const char *dest,Channel *chan,int status); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(Channel* channel); - void RemoveMode(User* user); + void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); + void RemoveMode(User* user, irc::modestacker* stack = NULL); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index dce0550fe..c06c0c007 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -24,6 +24,6 @@ class ModeChannelKey : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel); - void RemoveMode(Channel* channel); - void RemoveMode(User* user); + void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); + void RemoveMode(User* user, irc::modestacker* stack = NULL); }; diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h index f78ac8eb0..0c48eff1e 100644 --- a/include/modes/cmode_o.h +++ b/include/modes/cmode_o.h @@ -28,7 +28,7 @@ class ModeChannelOp : public ModeHandler std::string DelOp(User *user,const char *dest,Channel *chan,int status); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(Channel* channel); - void RemoveMode(User* user); + void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); + void RemoveMode(User* user, irc::modestacker* stack = NULL); }; diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h index f66761809..4e699fe9d 100644 --- a/include/modes/cmode_v.h +++ b/include/modes/cmode_v.h @@ -28,7 +28,7 @@ class ModeChannelVoice : public ModeHandler std::string DelVoice(User *user,const char *dest,Channel *chan,int status); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(User* user); - void RemoveMode(Channel* channel); + void RemoveMode(User* user, irc::modestacker* stack = NULL); + void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); }; diff --git a/include/u_listmode.h b/include/u_listmode.h index a388d7f18..6c6e2ca28 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -168,7 +168,7 @@ class ListModeBase : public ModeHandler * See mode.h * @param channel The channel to remove all instances of the mode from */ - virtual void RemoveMode(Channel* channel) + virtual void RemoveMode(Channel* channel, irc::modestacker* stack) { modelist* el; channel->GetExt(infokey, el); @@ -181,9 +181,15 @@ class ListModeBase : public ModeHandler for (modelist::iterator it = el->begin(); it != el->end(); it++) { - modestack.Push(this->GetModeChar(), assign(it->mask)); + if (stack) + stack->Push(this->GetModeChar(), assign(it->mask)); + else + modestack.Push(this->GetModeChar(), assign(it->mask)); } + if (stack) + return; + while (modestack.GetStackedLine(stackresult)) { for (size_t j = 0; j < stackresult.size(); j++) @@ -198,7 +204,7 @@ class ListModeBase : public ModeHandler /** See mode.h */ - virtual void RemoveMode(User*) + virtual void RemoveMode(User*, irc::modestacker* stack) { /* Listmodes dont get set on users */ } |