summaryrefslogtreecommitdiff
path: root/modules/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol')
-rw-r--r--modules/protocol/bahamut.cpp23
-rw-r--r--modules/protocol/hybrid.cpp51
-rw-r--r--modules/protocol/inspircd11.cpp61
-rw-r--r--modules/protocol/inspircd12.cpp87
-rw-r--r--modules/protocol/inspircd20.cpp33
-rw-r--r--modules/protocol/ngircd.cpp39
-rw-r--r--modules/protocol/plexus.cpp17
-rw-r--r--modules/protocol/ratbox.cpp24
-rw-r--r--modules/protocol/unreal.cpp82
9 files changed, 150 insertions, 267 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 839876d90..d9963485b 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -308,7 +308,7 @@ struct IRCDMessageBurst : IRCDMessage
{
IRCDMessageBurst(Module *creator) : IRCDMessage(creator, "BURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* If we found a server with the given source, that one just
* finished bursting. If there was no source, then our uplink
@@ -319,7 +319,6 @@ struct IRCDMessageBurst : IRCDMessage
s = Me->GetLinks().front();
if (s)
s->Sync(true);
- return true;
}
};
@@ -327,7 +326,7 @@ struct IRCDMessageMode : IRCDMessage
{
IRCDMessageMode(Module *creator, const Anope::string &sname) : IRCDMessage(creator, sname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() > 2 && IRCD->IsChannelValid(params[0]))
{
@@ -349,8 +348,6 @@ struct IRCDMessageMode : IRCDMessage
if (u)
u->SetModesInternal("%s", params[1].c_str());
}
-
- return true;
}
};
@@ -376,7 +373,7 @@ struct IRCDMessageNick : IRCDMessage
{
IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() == 10)
{
@@ -384,7 +381,7 @@ struct IRCDMessageNick : IRCDMessage
if (s == NULL)
{
Log(LOG_DEBUG) << "User " << params[0] << " introduced from nonexistant server " << params[6] << "?";
- return true;
+ return;
}
User *user = new User(params[0], params[4], params[5], "", params[8], s, params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3]);
@@ -404,8 +401,6 @@ struct IRCDMessageNick : IRCDMessage
}
else
source.GetUser()->ChangeNick(params[0]);
-
- return true;
}
};
@@ -413,11 +408,10 @@ struct IRCDMessageServer : IRCDMessage
{
IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]);
- return true;
}
};
@@ -425,7 +419,7 @@ struct IRCDMessageSJoin : IRCDMessage
{
IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Anope::string modes;
if (params.size() >= 4)
@@ -481,8 +475,6 @@ struct IRCDMessageSJoin : IRCDMessage
time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime;
Message::Join::SJoin(source, params[1], ts, modes, users);
-
- return true;
}
};
@@ -490,12 +482,11 @@ struct IRCDMessageTopic : IRCDMessage
{
IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 4) { }
- bool Run(MessageSource &, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &, const std::vector<Anope::string> &params) anope_override
{
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(params[1], params[3], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime);
- return true;
}
};
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index 1161db3fa..2597197ff 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -249,7 +249,7 @@ struct IRCDMessageBMask : IRCDMessage
/* 0 1 2 3 */
/* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Channel *c = Channel::Find(params[1]);
@@ -271,8 +271,6 @@ struct IRCDMessageBMask : IRCDMessage
c->SetModeInternal(source, invex, token);
}
}
-
- return true;
}
};
@@ -280,10 +278,9 @@ struct IRCDMessageEOB : IRCDMessage
{
IRCDMessageEOB(Module *craetor) : IRCDMessage(craetor, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetServer()->Sync(true);
- return true;
}
};
@@ -291,10 +288,10 @@ struct IRCDMessageJoin : Message::Join
{
IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() < 2)
- return true;
+ return;
std::vector<Anope::string> p = params;
p.erase(p.begin());
@@ -309,10 +306,9 @@ struct IRCDMessageNick : IRCDMessage
/* 0 1 */
/* :0MCAAAAAB NICK newnick 1350157102 */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->ChangeNick(params[0], convertTo<time_t>(params[1]));
- return true;
}
};
@@ -322,10 +318,9 @@ struct IRCDMessagePass : IRCDMessage
/* 0 1 2 3 */
/* PASS password TS 6 0MC */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
UplinkSID = params[3];
- return true;
}
};
@@ -333,10 +328,9 @@ struct IRCDMessagePong : IRCDMessage
{
IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetServer()->Sync(false);
- return true;
}
};
@@ -346,16 +340,15 @@ struct IRCDMessageServer : IRCDMessage
/* 0 1 2 */
/* SERVER hades.arpa 1 :ircd-hybrid test server */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* Servers other than our immediate uplink are introduced via SID */
if (params[1] != "1")
- return true;
+ return;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
IRCD->SendPing(Config->ServerName, params[0]);
- return true;
}
};
@@ -365,13 +358,12 @@ struct IRCDMessageSID : IRCDMessage
/* 0 1 2 3 */
/* :0MC SID hades.arpa 2 4XY :ircd-hybrid test server */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]);
IRCD->SendPing(Config->ServerName, params[0]);
- return true;
}
};
@@ -379,7 +371,7 @@ struct IRCDMessageSJoin : IRCDMessage
{
IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Anope::string modes;
if (params.size() >= 3)
@@ -424,8 +416,6 @@ struct IRCDMessageSJoin : IRCDMessage
time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime;
Message::Join::SJoin(source, params[1], ts, modes, users);
-
- return true;
}
};
@@ -439,17 +429,16 @@ struct IRCDMessageSVSMode : IRCDMessage
* parv[2] = mode
* parv[3] = optional argument (services id)
*/
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = User::Find(params[0]);
if (!u)
- return true;
+ return;
if (!params[1].is_pos_number_only() || convertTo<time_t>(params[1]) != u->timestamp)
- return true;
+ return;
u->SetModesInternal("%s", params[2].c_str());
- return true;
}
};
@@ -457,7 +446,7 @@ struct IRCDMessageTBurst : IRCDMessage
{
IRCDMessageTBurst(Module *creator) : IRCDMessage(creator, "TBURST", 5) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Anope::string setter;
sepstream(params[3], '!').GetToken(setter, 0);
@@ -466,8 +455,6 @@ struct IRCDMessageTBurst : IRCDMessage
if (c)
c->ChangeTopicInternal(setter, params[4], topic_time);
-
- return true;
}
};
@@ -475,7 +462,7 @@ struct IRCDMessageTMode : IRCDMessage
{
IRCDMessageTMode(Module *creator) : IRCDMessage(creator, "TMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
time_t ts = 0;
@@ -493,8 +480,6 @@ struct IRCDMessageTMode : IRCDMessage
if (c)
c->SetModesInternal(source, modes, ts);
-
- return true;
}
};
@@ -504,7 +489,7 @@ struct IRCDMessageUID : IRCDMessage
/* 0 1 2 3 4 5 6 7 8 9 */
/* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Anope::string ip = params[6];
@@ -534,8 +519,6 @@ struct IRCDMessageUID : IRCDMessage
else
NickServService->Validate(user);
}
-
- return true;
}
};
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index aaaec9fef..bc93e125e 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -338,7 +338,7 @@ struct IRCDMessageCapab : Message::Capab
{
IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params[0].equals_cs("START"))
{
@@ -542,21 +542,21 @@ struct IRCDMessageCapab : Message::Capab
UplinkSocket::Message() << "ERROR :m_globops is not loaded. This is required by Anope";
Anope::QuitReason = "ERROR: Remote server does not have the m_globops module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!has_servicesmod)
{
UplinkSocket::Message() << "ERROR :m_services is not loaded. This is required by Anope";
Anope::QuitReason = "ERROR: Remote server does not have the m_services module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!has_hidechansmod)
{
UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope";
Anope::QuitReason = "ERROR: Remote server deos not have the m_hidechans module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!IRCD->CanSVSHold)
Log() << "SVSHOLD missing, Usage disabled until module is loaded.";
@@ -566,7 +566,7 @@ struct IRCDMessageCapab : Message::Capab
Log() << "CHGIDENT missing, Usage disabled until module is loaded.";
}
- return Message::Capab::Run(source, params);
+ Message::Capab::Run(source, params);
}
};
@@ -574,17 +574,16 @@ struct IRCDMessageChgIdent : IRCDMessage
{
IRCDMessageChgIdent(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 2) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = User::Find(params[0]);
if (!u)
{
Log(LOG_DEBUG) << "CHGIDENT for nonexistent user " << params[0];
- return true;
+ return;
}
u->SetIdent(params[1]);
- return true;
}
};
@@ -592,10 +591,9 @@ struct IRCDMessageChgName : IRCDMessage
{
IRCDMessageChgName(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->SetRealname(params[0]);
- return true;
}
};
@@ -603,10 +601,9 @@ struct IRCDMessageEndBurst : IRCDMessage
{
IRCDMessageEndBurst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { }
- bool Run(MessageSource &, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &, const std::vector<Anope::string> &params) anope_override
{
Me->GetLinks().front()->Sync(true);
- return true;
}
};
@@ -614,10 +611,9 @@ struct IRCDMessageFHost : IRCDMessage
{
IRCDMessageFHost(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->SetDisplayedHost(params[0]);
- return true;
}
};
@@ -625,7 +621,7 @@ struct IRCDMessageFJoin : IRCDMessage
{
IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
std::list<Message::Join::SJoinUser> users;
@@ -664,8 +660,6 @@ struct IRCDMessageFJoin : IRCDMessage
time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime;
Message::Join::SJoin(source, params[0], ts, "", users);
-
- return true;
}
};
@@ -673,13 +667,13 @@ struct IRCDMessageFMode : IRCDMessage
{
IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* :source FMODE #test 12345678 +nto foo */
Channel *c = Channel::Find(params[0]);
if (!c)
- return true;
+ return;
time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : 0;
/* TS's are equal now, so we can proceed with parsing */
@@ -689,7 +683,6 @@ struct IRCDMessageFMode : IRCDMessage
modes += " " + params[n];
c->SetModesInternal(source, modes, ts);
- return true;
}
};
@@ -697,13 +690,11 @@ struct IRCDMessageFTopic : IRCDMessage
{
IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(params[2], params[3], Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime);
-
- return true;
}
};
@@ -711,11 +702,10 @@ struct IRCDMessageIdle : IRCDMessage
{
IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
const BotInfo *bi = BotInfo::Find(params[0]);
UplinkSocket::Message(bi) << "IDLE " << source.GetSource() << " " << Anope::StartTime << " " << (bi ? Anope::CurTime - bi->lastmsg : 0);
- return true;
}
};
@@ -723,7 +713,7 @@ struct IRCDMessageMode : IRCDMessage
{
IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (IRCD->IsChannelValid(params[0]))
{
@@ -748,8 +738,6 @@ struct IRCDMessageMode : IRCDMessage
if (u)
u->SetModesInternal("%s", params[1].c_str());
}
-
- return true;
}
};
@@ -757,7 +745,7 @@ struct IRCDMessageNick : IRCDMessage
{
IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params.size() == 8 && source.GetServer())
{
@@ -781,8 +769,6 @@ struct IRCDMessageNick : IRCDMessage
}
else if (params.size() == 1 && source.GetUser())
source.GetUser()->ChangeNick(params[0]);
-
- return true;
}
};
@@ -790,15 +776,13 @@ struct IRCDMessageOperType : IRCDMessage
{
IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* opertype is equivalent to mode +o because servers
dont do this directly */
User *u = source.GetUser();
if (!u->HasMode(UMODE_OPER))
u->SetModesInternal("+o");
-
- return true;
}
};
@@ -806,10 +790,10 @@ struct IRCDMessageRSQuit : IRCDMessage
{
IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params.empty() || params.size() > 3)
- return true;
+ return;
Server *s;
/* Horrible workaround to an insp bug (#) in how RSQUITs are sent - mark */
@@ -819,8 +803,6 @@ struct IRCDMessageRSQuit : IRCDMessage
s = Server::Find(params[0]);
source.GetServer()->Delete(source.GetServer()->GetName() + " " + (s ? s->GetName() : "<unknown>"));
-
- return true;
}
};
@@ -828,11 +810,10 @@ struct IRCDMessageServer : IRCDMessage
{
IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]);
- return true;
}
};
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 09ba57f00..242dd41e1 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -418,7 +418,7 @@ struct IRCDMessageCapab : Message::Capab
{
IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (params[0].equals_cs("START"))
{
@@ -726,21 +726,21 @@ struct IRCDMessageCapab : Message::Capab
UplinkSocket::Message() << "ERROR :m_globops is not loaded. This is required by Anope";
Anope::QuitReason = "Remote server does not have the m_globops module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!has_servicesmod)
{
UplinkSocket::Message() << "ERROR :m_services_account.so is not loaded. This is required by Anope";
Anope::QuitReason = "ERROR: Remote server does not have the m_services_account module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!has_hidechansmod)
{
UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope";
Anope::QuitReason = "ERROR: Remote server does not have the m_hidechans module loaded, and this is required.";
Anope::Quitting = true;
- return false;
+ return;
}
if (!IRCD->CanSVSHold)
Log() << "SVSHOLD missing, Usage disabled until module is loaded.";
@@ -750,9 +750,7 @@ struct IRCDMessageCapab : Message::Capab
Log() << "CHGIDENT missing, Usage disabled until module is loaded.";
}
- Servers::Capab.insert("NOQUIT");
-
- return Message::Capab::Run(source, params);
+ Message::Capab::Run(source, params);
}
};
@@ -760,12 +758,11 @@ struct IRCDMessageChgIdent : IRCDMessage
{
IRCDMessageChgIdent(Module *creator) : IRCDMessage(creator, "CHGIDENT", 2) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = User::Find(params[0]);
if (u)
u->SetIdent(params[1]);
- return true;
}
};
@@ -773,10 +770,9 @@ struct IRCDMessageChgName : IRCDMessage
{
IRCDMessageChgName(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->SetRealname(params[0]);
- return true;
}
};
@@ -784,14 +780,13 @@ struct IRCDMessageEndburst : IRCDMessage
{
IRCDMessageEndburst(Module *creator) : IRCDMessage(creator, "ENDBURST", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Server *s = source.GetServer();
Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName();
s->Sync(true);
- return true;
}
};
@@ -799,10 +794,9 @@ struct IRCDMessageFHost : IRCDMessage
{
IRCDMessageFHost(Module *creator, const Anope::string &n) : IRCDMessage(creator, n, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->SetDisplayedHost(params[0]);
- return true;
}
};
@@ -810,7 +804,7 @@ struct IRCDMessageFJoin : IRCDMessage
{
IRCDMessageFJoin(Module *creator) : IRCDMessage(creator, "FJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Anope::string modes;
if (params.size() >= 3)
@@ -856,8 +850,6 @@ struct IRCDMessageFJoin : IRCDMessage
time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime;
Message::Join::SJoin(source, params[0], ts, "", users);
-
- return true;
}
};
@@ -865,7 +857,7 @@ struct IRCDMessageFMode : IRCDMessage
{
IRCDMessageFMode(Module *creator) : IRCDMessage(creator, "FMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* :source FMODE #test 12345678 +nto foo */
@@ -887,8 +879,6 @@ struct IRCDMessageFMode : IRCDMessage
if (c)
c->SetModesInternal(source, modes, ts);
-
- return true;
}
};
@@ -896,15 +886,13 @@ struct IRCDMessageFTopic : IRCDMessage
{
IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* :source FTOPIC channel topicts setby :topic */
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(params[2], params[3], Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime);
-
- return true;
}
};
@@ -912,12 +900,11 @@ struct IRCDMessageIdle : IRCDMessage
{
IRCDMessageIdle(Module *creator) : IRCDMessage(creator, "IDLE", 1) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
const BotInfo *bi = BotInfo::Find(params[0]);
if (bi)
UplinkSocket::Message(bi) << "IDLE " << source.GetSource() << " " << Anope::StartTime << " " << (Anope::CurTime - bi->lastmsg);
- return true;
}
};
@@ -931,7 +918,7 @@ struct IRCDMessageMetadata : IRCDMessage
{
IRCDMessageMetadata(Module *creator) : IRCDMessage(creator, "METADATA", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (isdigit(params[0][0]))
{
@@ -964,7 +951,7 @@ struct IRCDMessageMetadata : IRCDMessage
{
User *u = User::Find(params[0]);
if (!u)
- return true;
+ return;
std::string data = params[2].c_str();
size_t pos1 = data.find(' ') + 1;
size_t pos2 = data.find(' ', pos1);
@@ -987,11 +974,11 @@ struct IRCDMessageMetadata : IRCDMessage
// only interested when it comes from our uplink
Server* server = source.GetServer();
if (!server || server->GetUplink() != Me)
- return true;
+ return;
bool plus = (params[2][0] == '+');
if (!plus && params[2][0] != '-')
- return true;
+ return;
bool required = false;
Anope::string module = params[2].substr(1);
@@ -1011,7 +998,7 @@ struct IRCDMessageMetadata : IRCDMessage
else if (module.equals_cs("m_topiclock.so"))
has_svstopic_topiclock = plus;
else
- return true;
+ return;
if (required)
{
@@ -1025,8 +1012,6 @@ struct IRCDMessageMetadata : IRCDMessage
}
}
-
- return true;
}
};
@@ -1034,7 +1019,7 @@ struct IRCDMessageMode : IRCDMessage
{
IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
if (IRCD->IsChannelValid(params[0]))
{
@@ -1062,8 +1047,6 @@ struct IRCDMessageMode : IRCDMessage
if (u)
u->SetModesInternal("%s", params[1].c_str());
}
-
- return true;
}
};
@@ -1071,10 +1054,9 @@ struct IRCDMessageNick : IRCDMessage
{
IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->ChangeNick(params[0]);
- return true;
}
};
@@ -1082,27 +1064,25 @@ struct IRCDMessageOperType : IRCDMessage
{
IRCDMessageOperType(Module *creator) : IRCDMessage(creator, "OPERTYPE", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* opertype is equivalent to mode +o because servers
dont do this directly */
User *u = source.GetUser();
if (!u->HasMode(UMODE_OPER))
u->SetModesInternal("+o");
-
- return true;
}
-}
-;
+};
+
struct IRCDMessageRSQuit : IRCDMessage
{
IRCDMessageRSQuit(Module *creator) : IRCDMessage(creator, "RSQUIT", 1) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
Server *s = Server::Find(params[0]);
if (!s)
- return true;
+ return;
/* On InspIRCd we must send a SQUIT when we recieve RSQUIT for a server we have juped */
if (s->HasFlag(SERVER_JUPED))
@@ -1111,8 +1091,6 @@ struct IRCDMessageRSQuit : IRCDMessage
FOREACH_MOD(I_OnServerQuit, OnServerQuit(s));
s->Delete(s->GetName() + " " + s->GetUplink()->GetName());
-
- return true;
}
};
@@ -1120,10 +1098,9 @@ struct IRCDMessageSetIdent : IRCDMessage
{
IRCDMessageSetIdent(Module *creator) : IRCDMessage(creator, "SETIDENT", 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
source.GetUser()->SetIdent(params[0]);
- return true;
}
};
@@ -1139,11 +1116,10 @@ struct IRCDMessageServer : IRCDMessage
* 3: numeric
* 4: desc
*/
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
unsigned int hops = Anope::string(params[2]).is_pos_number_only() ? convertTo<unsigned>(params[2]) : 0;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[4], params[3]);
- return true;
}
};
@@ -1151,10 +1127,9 @@ struct IRCDMessageTime : IRCDMessage
{
IRCDMessageTime(Module *creator) : IRCDMessage(creator, "TIME", 2) { }
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
UplinkSocket::Message(Me) << "TIME " << source.GetSource() << " " << params[1] << " " << Anope::CurTime;
- return true;
}
};
@@ -1175,7 +1150,7 @@ struct IRCDMessageUID : IRCDMessage
* 8+: modes and params -- IMPORTANT, some modes (e.g. +s) may have parameters. So don't assume a fixed position of realname!
* last: realname
*/
- bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
+ void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
time_t ts = convertTo<time_t>(params[1]);
@@ -1186,8 +1161,6 @@ struct IRCDMessageUID : IRCDMessage
User *u = new User(params[2], params[5], params[3], params[4], params[6], source.GetServer(), params[params.size() - 1], ts, modes, params[0]);
if (u->server->IsSynced() && NickServService)
NickServService->Validate(u);
-
- return true;
}
};
@@ -1247,6 +1220,8 @@ class ProtoInspIRCd : public Module
Implementation i[] = { I_OnUserNickChange, I_OnServerSync };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
+ Servers::Capab.insert("NOQUIT");
+