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_autoop.cpp | |
parent | 34fa5627de0a0431ca76f34445c680a76a9a7dc5 (diff) |
Move prefix mode specific fields and getters into PrefixMode
Add ModeHandler::IsPrefixMode()
Diffstat (limited to 'src/modules/m_autoop.cpp')
-rw-r--r-- | src/modules/m_autoop.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index 8ecee9578..d195345ca 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -32,13 +32,13 @@ class AutoOpList : public ListModeBase tidy = false; } - ModeHandler* FindMode(const std::string& mid) + PrefixMode* FindMode(const std::string& mid) { if (mid.length() == 1) - return ServerInstance->Modes->FindMode(mid[0], MODETYPE_CHANNEL); + return ServerInstance->Modes->FindPrefixMode(mid[0]); for(char c='A'; c < 'z'; c++) { - ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL); + PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(c); if (mh && mh->name == mid) return mh; } @@ -52,9 +52,9 @@ class AutoOpList : public ListModeBase return adding ? MOD_RES_DENY : MOD_RES_PASSTHRU; unsigned int mylevel = channel->GetPrefixValue(source); std::string mid = parameter.substr(0, pos); - ModeHandler* mh = FindMode(mid); + PrefixMode* mh = FindMode(mid); - if (adding && (!mh || !mh->GetPrefixRank())) + if (adding && !mh) { source->WriteNumeric(415, "%s %s :Cannot find prefix mode '%s' for autoop", source->nick.c_str(), mid.c_str(), mid.c_str()); @@ -103,8 +103,8 @@ class ModuleAutoOp : public Module continue; if (memb->chan->CheckBan(memb->user, it->mask.substr(colon+1))) { - ModeHandler* given = mh.FindMode(it->mask.substr(0, colon)); - if (given && given->GetPrefixRank()) + PrefixMode* given = mh.FindMode(it->mask.substr(0, colon)); + if (given) modeline.push_back(given->GetModeChar()); } } |