diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-05-26 23:23:47 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-05-27 01:07:30 +0200 |
commit | 3406c7234ac15b6a2fc52afa770fb851da25c215 (patch) | |
tree | a772480ea9d1d01f038ea4f7704630831ca35541 /src | |
parent | 9bb24d3f458274b7485554bc95f1274900a69ec2 (diff) |
Simplify user mode removal via ModeHandler::RemoveMode()
The function does not need to be virtual because the core can remove any user mode using the default logic
The optional modestack parameter was always NULL, so remove it
Diffstat (limited to 'src')
-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 |
7 files changed, 7 insertions, 40 deletions
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); |