Anope IRC Services  Version 2.0
messages.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) 2003-2014 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 
13 #include "protocol.h"
14 
15 /* Common IRCD messages.
16  * Protocol modules may chose to include some, none, or all of these handlers
17  * as they see fit.
18  */
19 
20 namespace Message
21 {
22 
24  {
25  Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
26 
27  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
28  };
29 
31  {
32  Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
33 
34  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
35  };
36 
38  {
39  Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
40 
41  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
42  };
43 
45  {
46  Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
47 
48  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
49  };
50 
52  {
53  Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
54 
55  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
56 
57  typedef std::pair<ChannelStatus, User *> SJoinUser;
58 
66  static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
67  };
68 
70  {
71  Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
72 
73  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
74  };
75 
77  {
78  Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
79 
80  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
81  };
82 
84  {
85  Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
86 
87  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
88  };
89 
91  {
92  MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
93 
94  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
95  };
96 
98  {
99  Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
100 
101  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
102  };
103 
105  {
106  Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
107 
108  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
109  };
110 
112  {
113  Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
114 
115  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
116  };
117 
119  {
120  Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
121 
122  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
123  };
124 
126  {
127  Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
128 
129  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
130  };
131 
133  {
134  SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
135 
136  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
137  };
138 
140  {
141  Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
142 
143  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
144  };
145 
147  {
148  Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
149 
150  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
151  };
152 
154  {
155  Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
156 
157  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
158  };
159 
161  {
162  Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
163 
164  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
165  };
166 
168  {
169  Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
170 
171  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
172  };
173 
174 } // namespace Message
175 
SQuit(Module *creator, const Anope::string &mname="SQUIT")
Definition: messages.h:134
Stats(Module *creator, const Anope::string &mname="STATS")
Definition: messages.h:141
Away(Module *creator, const Anope::string &mname="AWAY")
Definition: messages.h:25
Join(Module *creator, const Anope::string &mname="JOIN")
Definition: messages.h:53
Capab(Module *creator, const Anope::string &mname="CAPAB")
Definition: messages.h:32
Mode(Module *creator, const Anope::string &mname="MODE")
Definition: messages.h:85
Version(Module *creator, const Anope::string &mname="VERSION")
Definition: messages.h:162
MOTD(Module *creator, const Anope::string &mname="MOTD")
Definition: messages.h:92
Part(Module *creator, const Anope::string &mname="PART")
Definition: messages.h:106
Quit(Module *creator, const Anope::string &mname="QUIT")
Definition: messages.h:127
Topic(Module *creator, const Anope::string &mname="TOPIC")
Definition: messages.h:155
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
Kick(Module *creator, const Anope::string &mname="KICK")
Definition: messages.h:71
#define anope_override
Definition: services.h:56
#define CoreExport
Definition: services.h:62
std::pair< ChannelStatus, User * > SJoinUser
Definition: messages.h:57
Kill(Module *creator, const Anope::string &mname="KILL")
Definition: messages.h:78
Notice(Module *creator, const Anope::string &mname="NOTICE")
Definition: messages.h:99
Privmsg(Module *creator, const Anope::string &mname="PRIVMSG")
Definition: messages.h:120
Invite(Module *creator, const Anope::string &mname="INVITE")
Definition: messages.h:46
Time(Module *creator, const Anope::string &mname="TIME")
Definition: messages.h:148
Ping(Module *creator, const Anope::string &mname="PING")
Definition: messages.h:113
Whois(Module *creator, const Anope::string &mname="WHOIS")
Definition: messages.h:169
Error(Module *creator, const Anope::string &mname="ERROR")
Definition: messages.h:39