summaryrefslogtreecommitdiff
path: root/src/modules/m_rmode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_rmode.cpp')
-rw-r--r--src/modules/m_rmode.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp
index dde9f496e..37c6e62ff 100644
--- a/src/modules/m_rmode.cpp
+++ b/src/modules/m_rmode.cpp
@@ -60,17 +60,18 @@ class CommandRMode : public Command
PrefixMode* pm;
ListModeBase* lm;
ListModeBase::ModeList* ml;
- irc::modestacker modestack(false);
+ Modes::ChangeList changelist;
if ((pm = mh->IsPrefixMode()))
{
// As user prefix modes don't have a GetList() method, let's iterate through the channel's users.
- for (UserMembIter it = chan->userlist.begin(); it != chan->userlist.end(); ++it)
+ const Channel::MemberMap& users = chan->GetUsers();
+ for (Channel::MemberMap::const_iterator it = users.begin(); it != users.end(); ++it)
{
if (!InspIRCd::Match(it->first->nick, pattern))
continue;
- if (it->second->hasMode(modeletter) && !((it->first == user) && (pm->GetPrefixRank() > VOICE_VALUE)))
- modestack.Push(modeletter, it->first->nick);
+ if (it->second->HasMode(pm) && !((it->first == user) && (pm->GetPrefixRank() > VOICE_VALUE)))
+ changelist.push_remove(mh, it->first->nick);
}
}
else if ((lm = mh->IsListModeBase()) && ((ml = lm->GetList(chan)) != NULL))
@@ -79,23 +80,16 @@ class CommandRMode : public Command
{
if (!InspIRCd::Match(it->mask, pattern))
continue;
- modestack.Push(modeletter, it->mask);
+ changelist.push_remove(mh, it->mask);
}
}
else
{
if (chan->IsModeSet(mh))
- modestack.Push(modeletter);
- }
-
- parameterlist stackresult;
- stackresult.push_back(chan->name);
- while (modestack.GetStackedLine(stackresult))
- {
- ServerInstance->Modes->Process(stackresult, user);
- stackresult.erase(stackresult.begin() + 1, stackresult.end());
+ changelist.push_remove(mh);
}
+ ServerInstance->Modes->Process(user, chan, NULL, changelist);
return CMD_SUCCESS;
}
};