1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 16:53:13 +02:00

Add a message handler for messages that can be safely ignored.

This commit is contained in:
Sadie Powell
2025-04-02 13:17:38 +01:00
parent 69393a5f14
commit 404bf77ef5
4 changed files with 26 additions and 1 deletions
+7
View File
@@ -45,6 +45,13 @@ namespace Message
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Ignore final
: IRCDMessage
{
Ignore(Module *creator, const Anope::string &mname);
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Invite
: IRCDMessage
{
+1 -1
View File
@@ -362,7 +362,7 @@ public:
FLAG_MAX,
};
private:
protected:
/** The name of the message (e.g. PRIVMSG). */
const Anope::string name;
+6
View File
@@ -2537,6 +2537,10 @@ class ProtoInspIRCd final
Message::Stats message_stats;
Message::Time message_time;
/* Ignored message handlers. */
Message::Ignore message_burst;
Message::Ignore message_sinfo;
/* Our message handlers */
IRCDMessageAway message_away;
IRCDMessageCapab message_capab;
@@ -2587,6 +2591,8 @@ public:
, message_squery(this, "SQUERY")
, message_stats(this)
, message_time(this)
, message_burst(this, "BURST")
, message_sinfo(this, "SINFO")
, message_away(this)
, message_capab(this)
, message_chghost(this)
+12
View File
@@ -57,6 +57,18 @@ void Error::Run(MessageSource &source, const std::vector<Anope::string> &params,
Anope::Quitting = true;
}
Ignore::Ignore(Module *creator, const Anope::string &mname)
: IRCDMessage(creator, mname, 0)
{
SetFlag(FLAG_SOFT_LIMIT);
}
void Ignore::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
Log(LOG_DEBUG_3) << "Intentionally ignoring " << name << " message";
}
void Invite::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
User *targ = User::Find(params[0]);