summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp36
-rw-r--r--src/modes/cmode_b.cpp8
-rw-r--r--src/modes/cmode_h.cpp2
-rw-r--r--src/modes/cmode_k.cpp2
-rw-r--r--src/modes/cmode_l.cpp2
-rw-r--r--src/modes/cmode_o.cpp2
-rw-r--r--src/modes/cmode_t.cpp2
-rw-r--r--src/modes/cmode_v.cpp2
-rw-r--r--src/modes/umode_o.cpp2
-rw-r--r--src/modes/umode_s.cpp2
-rw-r--r--src/modules.cpp4
-rw-r--r--src/modules/m_auditorium.cpp2
-rw-r--r--src/modules/m_banredirect.cpp2
-rw-r--r--src/modules/m_chanprotect.cpp4
-rw-r--r--src/modules/m_cloaking.cpp2
-rw-r--r--src/modules/m_commonchans.cpp2
-rw-r--r--src/modules/m_deaf.cpp2
-rw-r--r--src/modules/m_delayjoin.cpp4
-rw-r--r--src/modules/m_delaymsg.cpp4
-rw-r--r--src/modules/m_helpop.cpp2
-rw-r--r--src/modules/m_hidechans.cpp2
-rw-r--r--src/modules/m_hideoper.cpp2
-rw-r--r--src/modules/m_invisible.cpp6
-rw-r--r--src/modules/m_joinflood.cpp2
-rw-r--r--src/modules/m_kicknorejoin.cpp2
-rw-r--r--src/modules/m_messageflood.cpp2
-rw-r--r--src/modules/m_nickflood.cpp2
-rw-r--r--src/modules/m_noctcp.cpp2
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_operchans.cpp2
-rw-r--r--src/modules/m_operprefix.cpp8
-rw-r--r--src/modules/m_permchannels.cpp4
-rw-r--r--src/modules/m_redirect.cpp4
-rw-r--r--src/modules/m_services_account.cpp6
-rw-r--r--src/modules/m_servprotect.cpp6
-rw-r--r--src/modules/m_showwhois.cpp2
-rw-r--r--src/modules/m_spanningtree/fmode.cpp2
-rw-r--r--src/modules/m_sslmodes.cpp2
38 files changed, 71 insertions, 75 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index e31855e77..a89227982 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -126,7 +126,7 @@ std::string ModeHandler::GetUserParameter(User* user)
return "";
}
-ModeAction ModeHandler::OnModeChange(User*, User*, Channel*, std::string&, bool, bool)
+ModeAction ModeHandler::OnModeChange(User*, User*, Channel*, std::string&, bool)
{
return MODEACTION_DENY;
}
@@ -160,7 +160,7 @@ bool ModeHandler::CheckTimeStamp(std::string& theirs, const std::string& ours, C
return (theirs < ours);
}
-ModeAction SimpleUserModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction SimpleUserModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
@@ -183,7 +183,7 @@ ModeAction SimpleUserModeHandler::OnModeChange(User* source, User* dest, Channel
}
-ModeAction SimpleChannelModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction SimpleChannelModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
@@ -223,12 +223,12 @@ ModeType ModeWatcher::GetModeType()
return m_type;
}
-bool ModeWatcher::BeforeMode(User*, User*, Channel*, std::string&, bool, ModeType, bool)
+bool ModeWatcher::BeforeMode(User*, User*, Channel*, std::string&, bool, ModeType)
{
return true;
}
-void ModeWatcher::AfterMode(User*, User*, Channel*, const std::string&, bool, ModeType, bool)
+void ModeWatcher::AfterMode(User*, User*, Channel*, const std::string&, bool, ModeType)
{
}
@@ -342,7 +342,7 @@ void ModeParser::DisplayCurrentModes(User *user, User* targetuser, Channel* targ
}
ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool adding, const unsigned char modechar,
- std::string &parameter, bool servermode, bool SkipACL)
+ std::string &parameter, bool SkipACL)
{
ModeType type = chan ? MODETYPE_CHANNEL : MODETYPE_USER;
unsigned char mask = chan ? MASK_CHANNEL : MASK_USER;
@@ -351,7 +351,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
int pcnt = mh->GetNumParams(adding);
int MOD_RESULT = 0;
- FOREACH_RESULT(I_OnRawMode, OnRawMode(user, chan, modechar, parameter, adding, pcnt, servermode));
+ FOREACH_RESULT(I_OnRawMode, OnRawMode(user, chan, modechar, parameter, adding, pcnt));
if (IS_LOCAL(user) && (MOD_RESULT == ACR_DENY))
return MODEACTION_DENY;
@@ -397,7 +397,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
{
- if ((*watchers)->BeforeMode(user, targetuser, chan, parameter, adding, type, servermode) == false)
+ if ((*watchers)->BeforeMode(user, targetuser, chan, parameter, adding, type) == false)
return MODEACTION_DENY;
/* A module whacked the parameter completely, and there was one. abort. */
if (pcnt && parameter.empty())
@@ -432,7 +432,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
}
/* Call the handler for the mode */
- ModeAction ma = mh->OnModeChange(user, targetuser, chan, parameter, adding, servermode);
+ ModeAction ma = mh->OnModeChange(user, targetuser, chan, parameter, adding);
if (pcnt && parameter.empty())
return MODEACTION_DENY;
@@ -450,12 +450,12 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
}
for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
- (*watchers)->AfterMode(user, targetuser, chan, parameter, adding, type, servermode);
+ (*watchers)->AfterMode(user, targetuser, chan, parameter, adding, type);
return MODEACTION_ALLOW;
}
-void ModeParser::Process(const std::vector<std::string>& parameters, User *user, bool servermode, bool merge)
+void ModeParser::Process(const std::vector<std::string>& parameters, User *user, bool merge)
{
std::string target = parameters[0];
Channel* targetchannel = ServerInstance->FindChan(target);
@@ -481,7 +481,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
bool SkipAccessChecks = false;
- if (servermode || !IS_LOCAL(user) || ServerInstance->ULine(user->server))
+ if (!IS_LOCAL(user) || ServerInstance->ULine(user->server))
{
SkipAccessChecks = true;
}
@@ -555,7 +555,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
}
}
- ModeAction ma = TryMode(user, targetuser, targetchannel, adding, modechar, parameter, servermode, SkipAccessChecks);
+ ModeAction ma = TryMode(user, targetuser, targetchannel, adding, modechar, parameter, SkipAccessChecks);
if (ma != MODEACTION_ALLOW)
continue;
@@ -593,16 +593,12 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
LastParse.append(output_mode);
LastParse.append(output_parameters.str());
- if (!user && targetchannel)
- targetchannel->WriteChannelWithServ(ServerInstance->Config->ServerName, "MODE %s", LastParse.c_str());
- else if (!user && targetuser)
- targetuser->WriteServ("MODE %s", LastParse.c_str());
- else if (targetchannel)
+ if (targetchannel)
{
targetchannel->WriteChannel(user, "MODE %s", LastParse.c_str());
FOREACH_MOD(I_OnMode,OnMode(user, targetchannel, TYPE_CHANNEL, LastParseParams, LastParseTranslate));
}
- else if (targetuser)
+ else
{
targetuser->WriteFrom(user, "MODE %s", LastParse.c_str());
FOREACH_MOD(I_OnMode,OnMode(user, targetuser, TYPE_USER, LastParseParams, LastParseTranslate));
@@ -1033,7 +1029,7 @@ void ModeHandler::RemoveMode(User* user, irc::modestacker* stack)
sprintf(moderemove,"-%c",this->GetModeChar());
parameters.push_back(user->nick);
parameters.push_back(moderemove);
- ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient, true);
+ ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient);
}
}
}
diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp
index 595bdb99e..415d33c30 100644
--- a/src/modes/cmode_b.cpp
+++ b/src/modes/cmode_b.cpp
@@ -29,13 +29,13 @@ ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(Instance, NULL,
{
}
-ModeAction ModeChannelBan::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelBan::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
int status = channel->GetStatus(source);
/* Call the correct method depending on wether we're adding or removing the mode */
if (adding)
{
- parameter = this->AddBan(source, parameter, channel, status, servermode);
+ parameter = this->AddBan(source, parameter, channel, status);
}
else
{
@@ -92,7 +92,7 @@ void ModeChannelBan::DisplayEmptyList(User* user, Channel* channel)
user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name.c_str());
}
-std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan, int, bool servermode)
+std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan, int)
{
if ((!user) || (!chan))
{
@@ -135,7 +135,7 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
b.set_time = ServerInstance->Time();
b.data.assign(dest, 0, MAXBUF);
- b.set_by.assign(servermode ? ServerInstance->Config->ServerName : user->nick, 0, 64);
+ b.set_by.assign(user->nick, 0, 64);
chan->bans.push_back(b);
return dest;
}
diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp
index 24eacdb24..ce4a0ac56 100644
--- a/src/modes/cmode_h.cpp
+++ b/src/modes/cmode_h.cpp
@@ -75,7 +75,7 @@ void ModeChannelHalfOp::RemoveMode(User*, irc::modestacker* stack)
{
}
-ModeAction ModeChannelHalfOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelHalfOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
int status = channel->GetStatus(source);
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index 4ffc24686..c785f6705 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -61,7 +61,7 @@ void ModeChannelKey::RemoveMode(User*, irc::modestacker* stack)
{
}
-ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
bool exists = channel->IsModeSet('k');
if (IS_LOCAL(source))
diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp
index e0293de72..a2ba07f10 100644
--- a/src/modes/cmode_l.cpp
+++ b/src/modes/cmode_l.cpp
@@ -40,7 +40,7 @@ bool ModeChannelLimit::CheckTimeStamp(std::string &their_param, const std::strin
return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
}
-ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp
index cadd7ee26..9a271f9a6 100644
--- a/src/modes/cmode_o.cpp
+++ b/src/modes/cmode_o.cpp
@@ -73,7 +73,7 @@ void ModeChannelOp::RemoveMode(User*, irc::modestacker* stack)
{
}
-ModeAction ModeChannelOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
int status = channel->GetStatus(source);
diff --git a/src/modes/cmode_t.cpp b/src/modes/cmode_t.cpp
index ca6a4a105..6424e1f6c 100644
--- a/src/modes/cmode_t.cpp
+++ b/src/modes/cmode_t.cpp
@@ -21,7 +21,7 @@ ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Insta
{
}
-ModeAction ModeChannelTopicOps::OnModeChange(User*, User*, Channel* channel, std::string&, bool adding, bool servermode)
+ModeAction ModeChannelTopicOps::OnModeChange(User*, User*, Channel* channel, std::string&, bool adding)
{
if (channel->modes[CM_TOPICLOCK] != adding)
{
diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp
index cba8e7fd0..22cfb19ef 100644
--- a/src/modes/cmode_v.cpp
+++ b/src/modes/cmode_v.cpp
@@ -73,7 +73,7 @@ void ModeChannelVoice::RemoveMode(User*, irc::modestacker* stack)
{
}
-ModeAction ModeChannelVoice::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeChannelVoice::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
int status = channel->GetStatus(source);
diff --git a/src/modes/umode_o.cpp b/src/modes/umode_o.cpp
index 6848f6e17..02550ffe5 100644
--- a/src/modes/umode_o.cpp
+++ b/src/modes/umode_o.cpp
@@ -21,7 +21,7 @@ ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, N
{
}
-ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding, bool servermode)
+ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding)
{
/* Only opers can execute this class at all */
if (!ServerInstance->ULine(source->nick.c_str()) && !ServerInstance->ULine(source->server) && source->oper.empty())
diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp
index 8bac7cd53..c45c185dc 100644
--- a/src/modes/umode_s.cpp
+++ b/src/modes/umode_s.cpp
@@ -21,7 +21,7 @@ ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHan
{
}
-ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Channel*, std::string &parameter, bool adding, bool servermode)
+ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Channel*, std::string &parameter, bool adding)
{
/* Set the array fields */
if (adding)
diff --git a/src/modules.cpp b/src/modules.cpp
index ed85bedee..62a156ac6 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -141,7 +141,7 @@ bool Module::OnCheckReady(User*) { return true; }
int Module::OnUserRegister(User*) { return 0; }
int Module::OnUserPreKick(User*, User*, Channel*, const std::string&) { return 0; }
void Module::OnUserKick(User*, User*, Channel*, const std::string&, bool&) { }
-int Module::OnRawMode(User*, Channel*, const char, const std::string &, bool, int, bool) { return 0; }
+int Module::OnRawMode(User*, Channel*, const char, const std::string &, bool, int) { return 0; }
int Module::OnCheckInvite(User*, Channel*) { return 0; }
int Module::OnCheckKey(User*, Channel*, const std::string&) { return 0; }
int Module::OnCheckLimit(User*, Channel*) { return 0; }
@@ -764,7 +764,7 @@ void InspIRCd::AddCommand(Command *f)
void InspIRCd::SendMode(const std::vector<std::string>& parameters, User *user)
{
- this->Modes->Process(parameters, user, true);
+ this->Modes->Process(parameters, user);
}
void InspIRCd::DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream)
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index ae5fba018..594dccf90 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -20,7 +20,7 @@ class AuditoriumMode : public ModeHandler
public:
AuditoriumMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (channel->IsModeSet('u') != adding)
{
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 8bbdc1edc..316225893 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -42,7 +42,7 @@ class BanRedirect : public ModeWatcher
{
}
- bool BeforeMode(User* source, User* dest, Channel* channel, std::string &param, bool adding, ModeType type, bool)
+ bool BeforeMode(User* source, User* dest, Channel* channel, std::string &param, bool adding, ModeType type)
{
/* nick!ident@host -> nick!ident@host
* nick!ident@host#chan -> nick!ident@host#chan
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index 6301f56cb..e436e9225 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -179,7 +179,7 @@ class ChanFounder : public ModeHandler, public FounderProtectBase
{
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
User* theuser = FounderProtectBase::FindAndVerify(parameter, channel);
@@ -255,7 +255,7 @@ class ChanProtect : public ModeHandler, public FounderProtectBase
{
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
User* theuser = FounderProtectBase::FindAndVerify(parameter, channel);
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 77316a346..43f73bfe0 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -67,7 +67,7 @@ class CloakUser : public ModeHandler
{
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
/* For remote clients, we dont take any action, we just allow it.
* The local server where they are will set their cloak instead.
diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp
index 4aa420d1f..71639c51e 100644
--- a/src/modules/m_commonchans.cpp
+++ b/src/modules/m_commonchans.cpp
@@ -22,7 +22,7 @@ class PrivacyMode : public ModeHandler
public:
PrivacyMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'c', 0, 0, false, MODETYPE_USER, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp
index c3b31c873..0600d1ab9 100644
--- a/src/modules/m_deaf.cpp
+++ b/src/modules/m_deaf.cpp
@@ -22,7 +22,7 @@ class User_d : public ModeHandler
public:
User_d(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'd', 0, 0, false, MODETYPE_USER, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index 5f5a95432..d9eb83c48 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -21,7 +21,7 @@ class DelayJoinMode : public ModeHandler
public:
DelayJoinMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, Parent, 'D', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') {};
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
};
class ModuleDelayJoin : public Module
@@ -52,7 +52,7 @@ class ModuleDelayJoin : public Module
/* $ModDesc: Allows for delay-join channels (+D) where users dont appear to join until they speak */
-ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
/* no change */
if (channel->IsModeSet('D') == adding)
diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp
index 54a0f75d4..c40439ea8 100644
--- a/src/modules/m_delaymsg.cpp
+++ b/src/modules/m_delaymsg.cpp
@@ -39,7 +39,7 @@ class DelayMsgMode : public ModeHandler
return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
};
class ModuleDelayMsg : public Module
@@ -65,7 +65,7 @@ class ModuleDelayMsg : public Module
/* $ModDesc: Allows for delay-join channels (+D) where users dont appear to join until they speak */
-ModeAction DelayMsgMode::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ModeAction DelayMsgMode::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 1064714a2..d8a544039 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -24,7 +24,7 @@ class Helpop : public ModeHandler
public:
Helpop(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'h', 0, 0, false, MODETYPE_USER, true) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp
index 137bab92b..070a3ce53 100644
--- a/src/modules/m_hidechans.cpp
+++ b/src/modules/m_hidechans.cpp
@@ -22,7 +22,7 @@ class HideChans : public ModeHandler
public:
HideChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'I', 0, 0, false, MODETYPE_USER, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index 51d1259ed..be4de8f8d 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -22,7 +22,7 @@ class HideOper : public ModeHandler
public:
HideOper(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'H', 0, 0, false, MODETYPE_USER, true) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp
index 4a3846ce4..7ccd8188b 100644
--- a/src/modules/m_invisible.cpp
+++ b/src/modules/m_invisible.cpp
@@ -53,7 +53,7 @@ class InvisibleMode : public ModeHandler
delete qo;
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (dest->IsModeSet('Q') != adding)
{
@@ -112,7 +112,7 @@ class InvisibleDeOper : public ModeWatcher
{
}
- bool BeforeMode(User* source, User* dest, Channel* channel, std::string &param, bool adding, ModeType type, bool)
+ bool BeforeMode(User* source, User* dest, Channel* channel, std::string &param, bool adding, ModeType type)
{
/* Users who are opers and have +Q get their +Q removed when they deoper */
if ((!adding) && (dest->IsModeSet('Q')))
@@ -120,7 +120,7 @@ class InvisibleDeOper : public ModeWatcher
std::vector<std::string> newmodes;
newmodes.push_back(dest->nick);
newmodes.push_back("-Q");
- ServerInstance->Modes->Process(newmodes, source, true);
+ ServerInstance->Modes->Process(newmodes, source);
}
return true;
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index ac194decd..c83df92c4 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -97,7 +97,7 @@ class JoinFlood : public ModeHandler
return std::make_pair(false, parameter);
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
joinfloodsettings* dummy;
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 915480ed9..5327c0592 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -40,7 +40,7 @@ class KickRejoin : public ModeHandler
return std::make_pair(false, parameter);
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (!adding)
{
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 007047e10..fc62cd67e 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -87,7 +87,7 @@ class MsgFlood : public ModeHandler
return std::make_pair(false, parameter);
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
floodsettings *f;
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index d0e4eaeb6..614843901 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -101,7 +101,7 @@ class NickFlood : public ModeHandler
return std::make_pair(false, parameter);
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
nickfloodsettings* dummy;
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 6f9ddf8ed..f58fd192c 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -20,7 +20,7 @@ class NoCTCP : public ModeHandler
public:
NoCTCP(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'C', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 1a8e83795..1b34c7597 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -20,7 +20,7 @@ class NoNicks : public ModeHandler
public:
NoNicks(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'N', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index da8f2c140..f714e00f6 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -21,7 +21,7 @@ class OperChans : public ModeHandler
/* This is an oper-only mode */
OperChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'O', 0, 0, false, MODETYPE_CHANNEL, true) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index d416d5699..deb826108 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -58,9 +58,9 @@ class OperPrefixMode : public ModeHandler
return OPERPREFIX_VALUE;
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
- if (servermode || (source && ServerInstance->ULine(source->server)))
+ if (IS_FAKE(source) || (source && ServerInstance->ULine(source->server)))
return MODEACTION_ALLOW;
else
{
@@ -151,10 +151,10 @@ class ModuleOperPrefixMode : public Module
}
// XXX: is there a better way to do this?
- virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt, bool servermode)
+ virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
{
/* force event propagation to its ModeHandler */
- if (!servermode && chan && (mode == 'y'))
+ if (!IS_FAKE(user) && chan && (mode == 'y'))
return ACR_ALLOW;
return 0;
}
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index 100afea9a..f765c2422 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -23,7 +23,7 @@ class PermChannel : public ModeHandler
public:
PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool sm)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (!source->HasPrivPermission("channels/set-permanent"))
{
@@ -43,7 +43,7 @@ class PermChannel : public ModeHandler
{
if (channel->IsModeSet('P'))
{
- if (channel->GetUserCounter() == 0 && !sm)
+ if (channel->GetUserCounter() == 0 && !IS_FAKE(source))
{
/*
* ugh, ugh, UGH!
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index fc743402e..dd7d2e954 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -30,7 +30,7 @@ class Redirect : public ModeHandler
return std::make_pair(false, parameter);
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool server)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
@@ -44,7 +44,7 @@ class Redirect : public ModeHandler
}
}
- if (IS_LOCAL(source) && !IS_OPER(source) && !server)
+ if (IS_LOCAL(source) && !IS_OPER(source))
{
Channel* c = ServerInstance->FindChan(parameter);
if (!c)
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index e32973bd0..78fbb28dc 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -24,7 +24,7 @@ class Channel_r : public ModeHandler
public:
Channel_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'r', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
// only a u-lined server may add or remove the +r mode.
if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
@@ -54,9 +54,9 @@ class User_r : public ModeHandler
public:
User_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'r', 0, 0, false, MODETYPE_USER, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
- if (servermode || IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
+ if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
{
if ((adding && !dest->IsModeSet('r')) || (!adding && dest->IsModeSet('r')))
{
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 9a1da8465..f4729d848 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -22,7 +22,7 @@ class ServProtectMode : public ModeHandler
public:
ServProtectMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'k', 0, 0, false, MODETYPE_USER, true) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
/* Because this returns MODEACTION_DENY all the time, there is only ONE
* way to add this mode and that is at client introduction in the UID command,
@@ -71,12 +71,12 @@ class ModuleServProtectMode : public Module
}
}
- virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt, bool servermode)
+ virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
{
/* Check that the mode is not a server mode, it is being removed, the user making the change is local, there is a parameter,
* and the user making the change is not a uline
*/
- if (!servermode && !adding && chan && IS_LOCAL(user) && !param.empty() && !ServerInstance->ULine(user->server))
+ if (!adding && chan && IS_LOCAL(user) && !param.empty() && !ServerInstance->ULine(user->server))
{
/* Check if the parameter is a valid nick/uuid
*/
diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp
index bbc89a2b4..c6e9ed27c 100644
--- a/src/modules/m_showwhois.cpp
+++ b/src/modules/m_showwhois.cpp
@@ -22,7 +22,7 @@ class SeeWhois : public ModeHandler
public:
SeeWhois(InspIRCd* Instance, Module* Creator, bool IsOpersOnly) : ModeHandler(Instance, Creator, 'W', 0, 0, false, MODETYPE_USER, IsOpersOnly) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{
diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp
index 0328ad40b..d95c94284 100644
--- a/src/modules/m_spanningtree/fmode.cpp
+++ b/src/modules/m_spanningtree/fmode.cpp
@@ -97,7 +97,7 @@ bool TreeSocket::ForceMode(const std::string &source, parameterlist &params)
*/
if (TS <= ourTS)
{
- ServerInstance->Modes->Process(modelist, who, (who == Utils->ServerUser), true);
+ ServerInstance->Modes->Process(modelist, who, true);
/* HOT POTATO! PASS IT ON! */
Utils->DoOneToAllButSender(source,"FMODE",params,sourceserv);
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index 641d68544..b05f73326 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -24,7 +24,7 @@ class SSLMode : public ModeHandler
public:
SSLMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
if (adding)
{