diff options
-rw-r--r-- | include/builtinmodes.h | 3 | ||||
-rw-r--r-- | include/listmode.h | 4 | ||||
-rw-r--r-- | include/mode.h | 10 | ||||
-rw-r--r-- | src/listmode.cpp | 5 | ||||
-rw-r--r-- | src/mode.cpp | 22 | ||||
-rw-r--r-- | src/modes/cmode_k.cpp | 4 | ||||
-rw-r--r-- | src/modes/cmode_o.cpp | 4 | ||||
-rw-r--r-- | src/modes/cmode_v.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_customprefix.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_ojoin.cpp | 4 |
10 files changed, 10 insertions, 54 deletions
diff --git a/include/builtinmodes.h b/include/builtinmodes.h index 46bfe282b..ba34a3da9 100644 --- a/include/builtinmodes.h +++ b/include/builtinmodes.h @@ -52,7 +52,6 @@ class ModeChannelKey : public ModeHandler public: ModeChannelKey(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); - void RemoveMode(User* user, irc::modestacker* stack = NULL); }; /** Channel mode +l @@ -94,7 +93,6 @@ class ModeChannelOp : public ModeHandler ModeChannelOp(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetPrefixRank(); - void RemoveMode(User* user, irc::modestacker* stack = NULL); }; /** Channel mode +p @@ -136,7 +134,6 @@ class ModeChannelVoice : public ModeHandler ModeChannelVoice(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetPrefixRank(); - void RemoveMode(User* user, irc::modestacker* stack = NULL); }; /** User mode +i diff --git a/include/listmode.h b/include/listmode.h index b4601fcbd..149f41578 100644 --- a/include/listmode.h +++ b/include/listmode.h @@ -152,10 +152,6 @@ class CoreExport ListModeBase : public ModeHandler */ virtual void RemoveMode(Channel* channel, irc::modestacker& stack); - /** Listmodes don't get set on users, no-op - */ - virtual void RemoveMode(User*, irc::modestacker* stack); - /** Perform a rehash of this mode's configuration data */ virtual void DoRehash(); diff --git a/include/mode.h b/include/mode.h index 6afd00a86..2cc5d6681 100644 --- a/include/mode.h +++ b/include/mode.h @@ -275,15 +275,11 @@ class CoreExport ModeHandler : public ServiceProvider virtual bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel); /** - * When a MODETYPE_USER mode handler is being removed, the server will call this method for every user on the server. - * Your mode handler should remove its user mode from the user by sending the appropriate server modes using - * InspIRCd::SendMode(). The default implementation of this method can remove simple modes which have no parameters, - * and can be used when your mode is of this type, otherwise you must implement a more advanced version of it to remove - * your mode properly from each user. + * When a MODETYPE_USER mode handler is being removed, the core will call this method for every user on the server. + * The usermode will be removed using the appropiate server mode using InspIRCd::SendMode(). * @param user The user which the server wants to remove your mode from - * @param stack The mode stack to add the mode change to */ - virtual void RemoveMode(User* user, irc::modestacker* stack = NULL); + void RemoveMode(User* user); /** * When a MODETYPE_CHANNEL mode handler is being removed, the server will call this method for every channel on the server. diff --git a/src/listmode.cpp b/src/listmode.cpp index 5d54d8417..b7b1cbc51 100644 --- a/src/listmode.cpp +++ b/src/listmode.cpp @@ -57,11 +57,6 @@ void ListModeBase::RemoveMode(Channel* channel, irc::modestacker& stack) } } -void ListModeBase::RemoveMode(User*, irc::modestacker* stack) -{ - /* Listmodes dont get set on users */ -} - void ListModeBase::DoRehash() { ConfigTagList tags = ServerInstance->Config->ConfTags(configtag); diff --git a/src/mode.cpp b/src/mode.cpp index 3d0edb185..a9ac006ae 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -838,24 +838,16 @@ bool ModeParser::DelModeWatcher(ModeWatcher* mw) return true; } -/** This default implementation can remove simple user modes - */ -void ModeHandler::RemoveMode(User* user, irc::modestacker* stack) +void ModeHandler::RemoveMode(User* user) { + // Remove the mode if it's set on the user if (user->IsModeSet(this->GetModeChar())) { - if (stack) - { - stack->Push(this->GetModeChar()); - } - else - { - std::vector<std::string> parameters; - parameters.push_back(user->nick); - parameters.push_back("-"); - parameters[1].push_back(this->GetModeChar()); - ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient); - } + std::vector<std::string> parameters; + parameters.push_back(user->nick); + parameters.push_back("-"); + parameters[1].push_back(this->GetModeChar()); + ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient); } } diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 850bc69db..cb9ec5b0e 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -30,10 +30,6 @@ ModeChannelKey::ModeChannelKey() : ModeHandler(NULL, "key", 'k', PARAM_ALWAYS, M { } -void ModeChannelKey::RemoveMode(User*, irc::modestacker* stack) -{ -} - ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { bool exists = channel->IsModeSet('k'); diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp index 80c768a00..f0a729480 100644 --- a/src/modes/cmode_o.cpp +++ b/src/modes/cmode_o.cpp @@ -41,10 +41,6 @@ unsigned int ModeChannelOp::GetPrefixRank() return OP_VALUE; } -void ModeChannelOp::RemoveMode(User*, irc::modestacker* stack) -{ -} - ModeAction ModeChannelOp::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { return MODEACTION_ALLOW; diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 2371ca2fa..867c13243 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -41,10 +41,6 @@ unsigned int ModeChannelVoice::GetPrefixRank() return VOICE_VALUE; } -void ModeChannelVoice::RemoveMode(User*, irc::modestacker* stack) -{ -} - ModeAction ModeChannelVoice::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { return MODEACTION_ALLOW; diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index 6f9f4da28..67d1d2fe9 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -53,10 +53,6 @@ class CustomPrefixMode : public ModeHandler return MOD_RES_PASSTHRU; } - void RemoveMode(User* user, irc::modestacker* stack) - { - } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { return MODEACTION_ALLOW; diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 5b6335580..ff92f3fae 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -117,10 +117,6 @@ class NetworkPrefix : public ModeHandler return NETWORK_VALUE; } - void RemoveMode(User* user, irc::modestacker* stack) - { - } - ModResult AccessCheck(User* source, Channel* channel, std::string ¶meter, bool adding) { User* theuser = ServerInstance->FindNick(parameter); |