diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-02-11 03:09:01 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-02-11 03:09:01 +0000 |
commit | 35d20fbabe8babe761e938e4c9a65c47f303f81d (patch) | |
tree | d63df9936c370eae9bea4142a1b11454a229e87e /src/mode.cpp | |
parent | 6e470a0c86707d897f61fe98c77e242b6011fe3b (diff) |
Remove/Add cmode h according to <option:allowhalfop>. Fixes bug #715 reported by Strawberry.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11081 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index f2bbb98e5..e7f918e62 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -378,7 +378,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, seq++; mask = MASK_CHANNEL; - + while (mode && *mode) { unsigned char mletter = *mode; @@ -388,7 +388,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, mode++; continue; } - + /* Ensure the user doesnt request the same mode twice, * so they cant flood themselves off out of idiocy. */ @@ -432,7 +432,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, for(ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) { std::string dummyparam; - + if (!((*watchers)->BeforeMode(user, NULL, targetchannel, dummyparam, true, MODETYPE_CHANNEL))) display = false; } @@ -605,7 +605,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, */ if (needed && !prefixmode) prefixmode = FindPrefix('%'); - + unsigned int neededrank = prefixmode->GetPrefixRank(); /* Compare our rank on the channel against the rank of the required prefix, * allow if >= ours. Because mIRC and xchat throw a tizz if the modes shown @@ -626,7 +626,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, } bool had_parameter = !parameter.empty(); - + for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) { if ((*watchers)->BeforeMode(user, targetuser, targetchannel, parameter, adding, type, servermode) == false) @@ -700,7 +700,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user, output_sequence.append(adding ? "+" : "-"); last_successful_state_change = adding; } - + /* Add the mode letter */ output_sequence.push_back(modechar); @@ -931,9 +931,6 @@ std::string ModeParser::ChannelModeList() for (unsigned char mode = 'A'; mode <= 'z'; mode++) { - if ((!ServerInstance->Config->AllowHalfop) && (mode == 'h')) - continue; - unsigned char pos = (mode-65) | MASK_CHANNEL; if (modehandlers[pos]) @@ -950,9 +947,6 @@ std::string ModeParser::ParaModeList() for (unsigned char mode = 'A'; mode <= 'z'; mode++) { - if ((!ServerInstance->Config->AllowHalfop) && (mode == 'h')) - continue; - unsigned char pos = (mode-65) | MASK_CHANNEL; if ((modehandlers[pos]) && (modehandlers[pos]->GetNumParams(true))) @@ -1019,13 +1013,10 @@ std::string ModeParser::GiveModeList(ModeMasks m) for (unsigned char mode = 'A'; mode <= 'z'; mode++) { - if ((!ServerInstance->Config->AllowHalfop) && (mode == 'h')) - continue; - unsigned char pos = (mode-65) | m; /* One parameter when adding */ if (modehandlers[pos]) - { + { if (modehandlers[pos]->GetNumParams(true)) { if ((modehandlers[pos]->IsListMode()) && (!modehandlers[pos]->GetPrefix())) @@ -1055,14 +1046,13 @@ std::string ModeParser::GiveModeList(ModeMasks m) type4 += modehandlers[pos]->GetModeChar(); } } - } return type1 + "," + type2 + "," + type3 + "," + type4; } bool ModeParser::PrefixComparison(prefixtype one, prefixtype two) -{ +{ return one.second > two.second; } @@ -1075,9 +1065,6 @@ std::string ModeParser::BuildPrefixes() for (unsigned char mode = 'A'; mode <= 'z'; mode++) { - if ((!ServerInstance->Config->AllowHalfop) && (mode == 'h')) - continue; - unsigned char pos = (mode-65) | MASK_CHANNEL; if ((modehandlers[pos]) && (modehandlers[pos]->GetPrefix())) |