anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

messages.h (6405B)

      1 /*
      2  *
      3  * (C) 2003-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  *
      8  * Based on the original code of Epona by Lara.
      9  * Based on the original code of Services by Andy Church.
     10  */
     11 
     12 #include "protocol.h"
     13 
     14 /* Common IRCD messages.
     15  * Protocol modules may chose to include some, none, or all of these handlers
     16  * as they see fit.
     17  */
     18 
     19 namespace Message
     20 {
     21 
     22 	struct CoreExport Away : IRCDMessage
     23 	{
     24 		Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     25 
     26 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     27 	};
     28 
     29 	struct CoreExport Capab : IRCDMessage
     30 	{
     31 		Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     32 
     33 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     34 	};
     35 
     36 	struct CoreExport Error : IRCDMessage
     37 	{
     38 		Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
     39 
     40 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     41 	};
     42 
     43 	struct CoreExport Invite : IRCDMessage
     44 	{
     45 		Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     46 
     47 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     48 	};
     49 
     50 	struct CoreExport Join : IRCDMessage
     51 	{
     52 		Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     53 
     54 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     55 
     56 		typedef std::pair<ChannelStatus, User *> SJoinUser;
     57 
     58 		/** Handle a SJOIN.
     59 		 * @param source The source of the SJOIN
     60 		 * @param chan The channel the users are joining to
     61 		 * @param ts The TS for the channel
     62 		 * @param modes The modes sent with the SJOIN, if any
     63 		 * @param users The users and their status, if any
     64 		 */
     65 		static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
     66 	};
     67 
     68 	struct CoreExport Kick : IRCDMessage
     69 	{
     70 		Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     71 
     72 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     73 	};
     74 
     75 	struct CoreExport Kill : IRCDMessage
     76 	{
     77 		Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
     78 
     79 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     80 	};
     81 
     82 	struct CoreExport Mode : IRCDMessage
     83 	{
     84 		Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
     85 
     86 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     87 	};
     88 
     89 	struct CoreExport MOTD : IRCDMessage
     90 	{
     91 		MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
     92 
     93 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
     94 	};
     95 
     96 	struct CoreExport Notice : IRCDMessage
     97 	{
     98 		Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
     99 
    100 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    101 	};
    102 
    103 	struct CoreExport Part : IRCDMessage
    104 	{
    105 		Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    106 
    107 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    108 	};
    109 
    110 	struct CoreExport Ping : IRCDMessage
    111 	{
    112 		Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    113 
    114 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    115 	};
    116 
    117 	struct CoreExport Privmsg : IRCDMessage
    118 	{
    119 		Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
    120 
    121 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    122 	};
    123 
    124 	struct CoreExport Quit : IRCDMessage
    125 	{
    126 		Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
    127 
    128 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    129 	};
    130 
    131 	struct CoreExport SQuit : IRCDMessage
    132 	{
    133 		SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
    134 
    135 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    136 	};
    137 
    138 	struct CoreExport Stats : IRCDMessage
    139 	{
    140 		Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    141 
    142 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    143 	};
    144 
    145 	struct CoreExport Time : IRCDMessage
    146 	{
    147 		Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    148 
    149 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    150 	};
    151 
    152 	struct CoreExport Topic : IRCDMessage
    153 	{
    154 		Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
    155 
    156 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    157 	};
    158 
    159 	struct CoreExport Version : IRCDMessage
    160 	{
    161 		Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    162 
    163 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    164 	};
    165 
    166 	struct CoreExport Whois : IRCDMessage
    167 	{
    168 		Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
    169 
    170 		void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
    171 	};
    172 
    173 } // namespace Message