diff options
Diffstat (limited to 'include/messages.h')
-rw-r--r-- | include/messages.h | 134 |
1 files changed, 78 insertions, 56 deletions
diff --git a/include/messages.h b/include/messages.h index 9ad80442f..59e483923 100644 --- a/include/messages.h +++ b/include/messages.h @@ -9,6 +9,8 @@ * Based on the original code of Services by Andy Church. */ +#pragma once + #include "protocol.h" /* Common IRCD messages. @@ -19,39 +21,44 @@ namespace Message { - struct CoreExport Away : IRCDMessage + struct CoreExport Away + : IRCDMessage { - Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Capab : IRCDMessage + struct CoreExport Capab + : IRCDMessage { - Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Error : IRCDMessage + struct CoreExport Error + : IRCDMessage { Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Invite : IRCDMessage + struct CoreExport Invite + : IRCDMessage { - Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Join : IRCDMessage + struct CoreExport Join + : IRCDMessage { - Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; typedef std::pair<ChannelStatus, User *> SJoinUser; @@ -65,109 +72,124 @@ namespace Message static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users); }; - struct CoreExport Kick : IRCDMessage + struct CoreExport Kick + : IRCDMessage { - Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Kill : IRCDMessage + struct CoreExport Kill + : IRCDMessage { Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Mode : IRCDMessage + struct CoreExport Mode + : IRCDMessage { - Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport MOTD : IRCDMessage + struct CoreExport MOTD + : IRCDMessage { MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Notice : IRCDMessage + struct CoreExport Notice + : IRCDMessage { - Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } + Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Part : IRCDMessage + struct CoreExport Part + : IRCDMessage { - Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Ping : IRCDMessage + struct CoreExport Ping + : IRCDMessage { - Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Privmsg : IRCDMessage + struct CoreExport Privmsg + : IRCDMessage { - Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } + Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Quit : IRCDMessage + struct CoreExport Quit + : IRCDMessage { - Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } + Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport SQuit : IRCDMessage + struct CoreExport SQuit + : IRCDMessage { SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Stats : IRCDMessage + struct CoreExport Stats + : IRCDMessage { - Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Time : IRCDMessage + struct CoreExport Time + : IRCDMessage { - Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Topic : IRCDMessage + struct CoreExport Topic + : IRCDMessage { - Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } + Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Version : IRCDMessage + struct CoreExport Version + : IRCDMessage { - Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; - struct CoreExport Whois : IRCDMessage + struct CoreExport Whois + : IRCDMessage { - Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } + Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override; + void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override; }; } // namespace Message |