summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/configreader.h5
-rw-r--r--include/mode.h5
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules/m_spanningtree/capab.cpp1
-rw-r--r--src/modules/m_timedbans.cpp17
-rw-r--r--src/server.cpp2
7 files changed, 12 insertions, 24 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 4b425e03b..f5ce4b57a 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -376,11 +376,6 @@ class CoreExport ServerConfig
*/
bool RestrictBannedUsers;
- /** If this value is true, halfops have been
- * enabled in the configuration file.
- */
- bool AllowHalfop;
-
/** If this is set to true, then mode lists (e.g
* MODE #chan b) are hidden from unprivileged
* users.
diff --git a/include/mode.h b/include/mode.h
index 091d11c3d..f4e5e8a60 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -553,9 +553,10 @@ class CoreExport ModeParser
static bool PrefixComparison(ModeHandler* one, ModeHandler* two);
- /** This returns the PREFIX=(ohv)@%+ section of the 005 numeric.
+ /** This returns the PREFIX=(ohv)@%+ section of the 005 numeric, or
+ * just the "@%+" part if the parameter false
*/
- std::string BuildPrefixes();
+ std::string BuildPrefixes(bool lettersAndModes = true);
};
#endif
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 3785e066c..9e0aa2031 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -37,7 +37,7 @@ ServerConfig::ServerConfig()
{
WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0;
NoUserDns = OperSpyWhois = HideBans = HideSplits = UndernetMsgPrefix = false;
- CycleHosts = AllowHalfop = InvBypassModes = true;
+ CycleHosts = InvBypassModes = true;
dns_timeout = DieDelay = 5;
MaxTargets = 20;
NetBufferSize = 10240;
diff --git a/src/mode.cpp b/src/mode.cpp
index d12469aef..fd2517dce 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -803,7 +803,7 @@ std::string ModeParser::GiveModeList(ModeMasks m)
return type1 + "," + type2 + "," + type3 + "," + type4;
}
-std::string ModeParser::BuildPrefixes()
+std::string ModeParser::BuildPrefixes(bool lettersAndModes)
{
std::string mletters;
std::string mprefixes;
@@ -826,7 +826,7 @@ std::string ModeParser::BuildPrefixes()
mprefixes = mprefixes + n->second.second;
}
- return "(" + mprefixes + ")" + mletters;
+ return lettersAndModes ? "(" + mprefixes + ")" + mletters : mletters;
}
bool ModeParser::AddModeWatcher(ModeWatcher* mw)
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp
index 7953468e4..f11b3f6da 100644
--- a/src/modules/m_spanningtree/capab.cpp
+++ b/src/modules/m_spanningtree/capab.cpp
@@ -104,7 +104,6 @@ void TreeSocket::SendCapabilities(int phase)
this->WriteLine("CAPAB CAPABILITIES " /* Preprocessor does this one. */
":NICKMAX="+ConvToStr(ServerInstance->Config->Limits.NickMax)+
- " HALFOP="+ConvToStr(ServerInstance->Config->AllowHalfop)+
" CHANMAX="+ConvToStr(ServerInstance->Config->Limits.ChanMax)+
" MAXMODES="+ConvToStr(ServerInstance->Config->Limits.MaxModes)+
" IDENTMAX="+ConvToStr(ServerInstance->Config->Limits.IdentMax)+
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 94301bb7b..8e045360e 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -91,17 +91,15 @@ class CommandTban : public Command
TimedBanList.push_back(T);
channel->WriteAllExcept(user, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration);
ServerInstance->PI->SendChannelNotice(channel, '@', user->nick + " added a timed ban on " + mask + " lasting for " + ConvToStr(duration) + " seconds.");
- if (ServerInstance->Config->AllowHalfop)
- {
- channel->WriteAllExcept(user, true, '%', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration);
- ServerInstance->PI->SendChannelNotice(channel, '%', user->nick + " added a timed ban on " + mask + " lasting for " + ConvToStr(duration) + " seconds.");
- }
return CMD_SUCCESS;
}
return CMD_FAILURE;
}
- else user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), channel->name.c_str(),
- ServerInstance->Config->AllowHalfop ? " half-" : " channel ");
+ else
+ {
+ user->WriteNumeric(482, "%s %s :You do not have permission to change modes on this channel",
+ user->nick.c_str(), channel->name.c_str());
+ }
return CMD_FAILURE;
}
user->WriteNumeric(401, "%s %s :No such channel",user->nick.c_str(), parameters[0].c_str());
@@ -170,11 +168,6 @@ class ModuleTimedBans : public Module
std::string expiry = "*** Timed ban on " + chan + " expired.";
cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
ServerInstance->PI->SendChannelNotice(cr, '@', expiry);
- if (ServerInstance->Config->AllowHalfop)
- {
- cr->WriteAllExcept(ServerInstance->FakeClient, true, '%', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
- ServerInstance->PI->SendChannelNotice(cr, '%', expiry);
- }
ServerInstance->SendMode(setban, ServerInstance->FakeClient);
ServerInstance->PI->SendMode(chan, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
diff --git a/src/server.cpp b/src/server.cpp
index 57b853ebb..f89d4d67d 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -78,7 +78,7 @@ void InspIRCd::BuildISupport()
// the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it...
std::stringstream v;
v << "WALLCHOPS WALLVOICES MODES=" << Config->Limits.MaxModes - 1 << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << Config->Limits.NickMax - 1;
- v << " CASEMAPPING=rfc1459 STATUSMSG=@" << (this->Config->AllowHalfop ? "%" : "") << "+ CHARSET=ascii TOPICLEN=" << Config->Limits.MaxTopic - 1 << " KICKLEN=" << Config->Limits.MaxKick - 1 << " MAXTARGETS=" << Config->MaxTargets - 1;
+ v << " CASEMAPPING=rfc1459 STATUSMSG=" << Modes->BuildPrefixes(false) << " CHARSET=ascii TOPICLEN=" << Config->Limits.MaxTopic - 1 << " KICKLEN=" << Config->Limits.MaxKick - 1 << " MAXTARGETS=" << Config->MaxTargets - 1;
v << " AWAYLEN=" << Config->Limits.MaxAway - 1 << " CHANMODES=" << this->Modes->GiveModeList(MASK_CHANNEL) << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU";
Config->data005 = v.str();
FOREACH_MOD(I_On005Numeric,On005Numeric(Config->data005));