summaryrefslogtreecommitdiff
path: root/include/messages.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-01 01:56:57 -0400
committerAdam <Adam@anope.org>2012-10-01 01:56:57 -0400
commit89428a9d1032e3c2a6e397629a32862b3e58d708 (patch)
treed507904b3fa1cc084f0f3e688c839bcdd47f79d7 /include/messages.h
parentb937d6310d9a7c0e2434200306b63d513cb2ae61 (diff)
Cleanup of all of the protocol modules, rewrote message handling system to be a bit more C++ ish
Diffstat (limited to 'include/messages.h')
-rw-r--r--include/messages.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/include/messages.h b/include/messages.h
new file mode 100644
index 000000000..115f659af
--- /dev/null
+++ b/include/messages.h
@@ -0,0 +1,119 @@
+#include "protocol.h"
+
+/* Common IRCD messages.
+ * Protocol modules may chose to include some, none, or all of these handlers
+ * as they see fit.
+ */
+
+struct CoreIRCDMessageAway : IRCDMessage
+{
+ CoreIRCDMessageAway(const Anope::string &mname = "AWAY") : IRCDMessage(mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageCapab : IRCDMessage
+{
+ CoreIRCDMessageCapab(const Anope::string &mname = "CAPAB") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageError : IRCDMessage
+{
+ CoreIRCDMessageError(const Anope::string &mname = "ERROR") : IRCDMessage(mname, 1) { }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageJoin : IRCDMessage
+{
+ CoreIRCDMessageJoin(const Anope::string &mname = "JOIN") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageKill : IRCDMessage
+{
+ CoreIRCDMessageKill(const Anope::string &mname = "KILL") : IRCDMessage(mname, 2) { }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageMOTD : IRCDMessage
+{
+ CoreIRCDMessageMOTD(const Anope::string &mname = "MOTD") : IRCDMessage(mname, 1) { }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessagePart : IRCDMessage
+{
+ CoreIRCDMessagePart(const Anope::string &mname = "PART") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessagePing : IRCDMessage
+{
+ CoreIRCDMessagePing(const Anope::string &mname = "PING") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessagePrivmsg : IRCDMessage
+{
+ CoreIRCDMessagePrivmsg(const Anope::string &mname = "PRIVMSG") : IRCDMessage(mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageQuit : IRCDMessage
+{
+ CoreIRCDMessageQuit(const Anope::string &mname = "QUIT") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageSQuit : IRCDMessage
+{
+ CoreIRCDMessageSQuit(const Anope::string &mname = "SQUIT") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageStats : IRCDMessage
+{
+ CoreIRCDMessageStats(const Anope::string &mname = "STATS") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageTime : IRCDMessage
+{
+ CoreIRCDMessageTime(const Anope::string &mname = "TIME") : IRCDMessage(mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageTopic : IRCDMessage
+{
+ CoreIRCDMessageTopic(const Anope::string &mname = "TOPIC") : IRCDMessage(mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageVersion : IRCDMessage
+{
+ CoreIRCDMessageVersion(const Anope::string &mname = "VERSION") : IRCDMessage(mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+
+struct CoreIRCDMessageWhois : IRCDMessage
+{
+ CoreIRCDMessageWhois(const Anope::string &mname = "WHOIS") : IRCDMessage(mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
+
+ bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
+};
+