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:
@@ -45,6 +45,13 @@ namespace Message
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, 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> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Invite
|
||||
: IRCDMessage
|
||||
{
|
||||
|
||||
+1
-1
@@ -362,7 +362,7 @@ public:
|
||||
FLAG_MAX,
|
||||
};
|
||||
|
||||
private:
|
||||
protected:
|
||||
/** The name of the message (e.g. PRIVMSG). */
|
||||
const Anope::string name;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -57,6 +57,18 @@ void Error::Run(MessageSource &source, const std::vector<Anope::string> ¶ms,
|
||||
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> ¶ms, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
Log(LOG_DEBUG_3) << "Intentionally ignoring " << name << " message";
|
||||
}
|
||||
|
||||
|
||||
void Invite::Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
User *targ = User::Find(params[0]);
|
||||
|
||||
Reference in New Issue
Block a user