summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/messages.h36
-rw-r--r--include/modules.h9
-rw-r--r--include/protocol.h2
-rw-r--r--modules/commands/ns_ghost.cpp3
-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
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/messages.cpp88
-rw-r--r--src/process.cpp9
-rw-r--r--src/socketengines/pipeengine_pipe.cpp6
17 files changed, 227 insertions, 345 deletions
diff --git a/include/messages.h b/include/messages.h
index 1ef9638ff..a8ff0a9fc 100644
--- a/include/messages.h
+++ b/include/messages.h
@@ -24,28 +24,28 @@ namespace Message
{
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); 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;
};
struct CoreExport Capab : IRCDMessage
{
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Error : IRCDMessage
{
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Join : IRCDMessage
{
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); 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;
typedef std::pair<ChannelStatus, User *> SJoinUser;
@@ -63,98 +63,98 @@ namespace Message
{
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Kill : IRCDMessage
{
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Mode : IRCDMessage
{
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 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;
};
struct CoreExport MOTD : IRCDMessage
{
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Part : IRCDMessage
{
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); 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;
};
struct CoreExport Ping : IRCDMessage
{
Ping(Module *creator, const Anope::string &mname = "PPING") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Privmsg : IRCDMessage
{
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Quit : IRCDMessage
{
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 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;
};
struct CoreExport SQuit : IRCDMessage
{
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { 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;
};
struct CoreExport Stats : IRCDMessage
{
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); 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;
};
struct CoreExport Time : IRCDMessage
{
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { 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;
};
struct CoreExport Topic : IRCDMessage
{
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 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;
};
struct CoreExport Version : IRCDMessage
{
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { 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;
};
struct CoreExport Whois : IRCDMessage
{
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 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;
};
} // namespace Message
diff --git a/include/modules.h b/include/modules.h
index e62ed8e36..bbdfc5659 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -957,6 +957,14 @@ class CoreExport Module : public Extensible
* @return EVENT_STOP to halt immediately
*/
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { return EVENT_CONTINUE; }
+
+ /** Called whenever a message is received from the uplink
+ * @param source The source of the message
+ * @param command The command being executed
+ * @param params Parameters
+ * @return EVENT_STOP to prevent the protocol module from processing this message
+ */
+ virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> &param) { return EVENT_CONTINUE; }
};
/** Implementation-specific flags which may be set in ModuleManager::Attach()
@@ -1007,6 +1015,7 @@ enum Implementation
I_OnEncrypt, I_OnDecrypt,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, I_OnDnsRequest,
+ I_OnMessage,
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate,
I_END
diff --git a/include/protocol.h b/include/protocol.h
index ec7061d38..65b31680f 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -244,7 +244,7 @@ class CoreExport IRCDMessage : public Flags<IRCDMessageFlag>, public Service
public:
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
unsigned GetParamCount() const;
- virtual bool Run(MessageSource &, const std::vector<Anope::string> &params) = 0;
+ virtual void Run(MessageSource &, const std::vector<Anope::string> &params) = 0;
};
extern CoreExport IRCDProto *IRCD;
diff --git a/modules/commands/ns_ghost.cpp b/modules/commands/ns_ghost.cpp
index de85a941f..0f53d849e 100644
--- a/modules/commands/ns_ghost.cpp
+++ b/modules/commands/ns_ghost.cpp
@@ -198,12 +198,11 @@ class NSGhost : public Module
std::map<Anope::string, ChannelStatus>::iterator it = ei->find(c->name);
if (it != ei->end())
{
- ei->erase(it);
-
for (size_t j = CMODE_BEGIN + 1; j < CMODE_END; ++j)
if (it->second.HasFlag(static_cast<ChannelModeName>(j)))
c->SetMode(c->ci->WhoSends(), ModeManager::FindChannelModeByName(static_cast<ChannelModeName>(j)), u->GetUID());
+ ei->erase(it);
if (ei->empty())
u->Shrink("ns_ghost_info");
}
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);
}