From a09c6eb1ce2b91299137c42ff65d3e57468d3672 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 12 Jun 2007 16:30:32 +0000 Subject: Fix advertising of +h/% in 005 and 004 numerics when halfops are not enabled in the conf, spotted by Smartys, fixes bug #322 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7282 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index c38874229..14dd39b33 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -783,6 +783,9 @@ 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]) @@ -799,6 +802,9 @@ 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))) @@ -859,6 +865,9 @@ std::string ModeParser::ChanModes() for (unsigned char mode = 'A'; mode <= 'z'; mode++) { + if ((!ServerInstance->Config->AllowHalfop) && (mode == 'h')) + continue; + unsigned char pos = (mode-65) | MASK_CHANNEL; /* One parameter when adding */ if (modehandlers[pos]) @@ -912,6 +921,9 @@ 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())) -- cgit v1.2.3