diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-09-01 14:38:41 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-09-11 12:10:07 +0200 |
commit | 16398df07d4ce1f1d4a2e43d97bc39043f8d44b5 (patch) | |
tree | f12524963e8bf6a3b9c8014c5770f930229e802f /src/modules/m_rmode.cpp | |
parent | 34fa5627de0a0431ca76f34445c680a76a9a7dc5 (diff) |
Move prefix mode specific fields and getters into PrefixMode
Add ModeHandler::IsPrefixMode()
Diffstat (limited to 'src/modules/m_rmode.cpp')
-rw-r--r-- | src/modules/m_rmode.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index 1bbbb37bf..6d17820a5 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -56,9 +56,8 @@ class CommandRMode : public Command return CMD_FAILURE; } - unsigned int prefixrank; - char prefixchar; std::string pattern = parameters.size() > 2 ? parameters[2] : "*"; + PrefixMode* pm; ListModeBase* lm; ListModeBase::ModeList* ml; irc::modestacker modestack(false); @@ -68,14 +67,14 @@ class CommandRMode : public Command if (chan->IsModeSet(mh)) modestack.Push(modeletter); } - else if (((prefixrank = mh->GetPrefixRank()) && (prefixchar = mh->GetPrefix()))) + else 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) { if (!InspIRCd::Match(it->first->nick, pattern)) continue; - if (((strchr(chan->GetAllPrefixChars(user), prefixchar)) != NULL) && !(it->first == user && prefixrank > VOICE_VALUE)) + if (it->second->hasMode(modeletter) && !((it->first == user) && (pm->GetPrefixRank() > VOICE_VALUE))) modestack.Push(modeletter, it->first->nick); } } |