diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-05-26 23:23:47 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-05-27 01:07:29 +0200 |
commit | 9bb24d3f458274b7485554bc95f1274900a69ec2 (patch) | |
tree | 33ab45d74813198ba1377eab83b6a9904a91801e /src/listmode.cpp | |
parent | 244a65e8556328642350575c4a94ee8fc1b676b4 (diff) |
Deduplicate RemoveMode() implementations
The default (core) implementation can now remove prefix modes
The modestacker parameter is now mandatory
Diffstat (limited to 'src/listmode.cpp')
-rw-r--r-- | src/listmode.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/listmode.cpp b/src/listmode.cpp index 555f75fa3..5d54d8417 100644 --- a/src/listmode.cpp +++ b/src/listmode.cpp @@ -45,31 +45,14 @@ void ListModeBase::DisplayEmptyList(User* user, Channel* channel) user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str()); } -void ListModeBase::RemoveMode(Channel* channel, irc::modestacker* stack) +void ListModeBase::RemoveMode(Channel* channel, irc::modestacker& stack) { ChanData* cd = extItem.get(channel); if (cd) { - irc::modestacker modestack(false); - for (ModeList::iterator it = cd->list.begin(); it != cd->list.end(); it++) { - if (stack) - stack->Push(this->GetModeChar(), it->mask); - else - modestack.Push(this->GetModeChar(), it->mask); - } - - if (stack) - return; - - std::vector<std::string> stackresult; - stackresult.push_back(channel->name); - while (modestack.GetStackedLine(stackresult)) - { - ServerInstance->SendMode(stackresult, ServerInstance->FakeClient); - stackresult.clear(); - stackresult.push_back(channel->name); + stack.Push(this->GetModeChar(), it->mask); } } } |