1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 03:13:13 +02:00

Change the return type of ircdmessage to void now that we don't use it, add an ircd message module event, and a few more fixups

This commit is contained in:
Adam
2012-11-23 16:56:06 -05:00
parent 0e7bd9f3ba
commit 36b1166cf6
17 changed files with 227 additions and 345 deletions
+18 -18
View File
@@ -24,28 +24,28 @@ namespace Message
{
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Capab : IRCDMessage
{
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Error : IRCDMessage
{
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Join : IRCDMessage
{
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
typedef std::pair<ChannelStatus, User *> SJoinUser;
@@ -63,98 +63,98 @@ namespace Message
{
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Kill : IRCDMessage
{
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Mode : IRCDMessage
{
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport MOTD : IRCDMessage
{
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Part : IRCDMessage
{
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Ping : IRCDMessage
{
Ping(Module *creator, const Anope::string &mname = "PPING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Privmsg : IRCDMessage
{
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Quit : IRCDMessage
{
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport SQuit : IRCDMessage
{
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Stats : IRCDMessage
{
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Time : IRCDMessage
{
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Topic : IRCDMessage
{
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Version : IRCDMessage
{
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
struct CoreExport Whois : IRCDMessage
{
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
} // namespace Message
+9
View File
@@ -957,6 +957,14 @@ class CoreExport Module : public Extensible
* @return EVENT_STOP to halt immediately
*/
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { return EVENT_CONTINUE; }
/** Called whenever a message is received from the uplink
* @param source The source of the message
* @param command The command being executed
* @param params Parameters
* @return EVENT_STOP to prevent the protocol module from processing this message
*/
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> &param) { return EVENT_CONTINUE; }
};
/** Implementation-specific flags which may be set in ModuleManager::Attach()
@@ -1007,6 +1015,7 @@ enum Implementation
I_OnEncrypt, I_OnDecrypt,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, I_OnDnsRequest,
I_OnMessage,
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate,
I_END
+1 -1
View File
@@ -244,7 +244,7 @@ class CoreExport IRCDMessage : public Flags<IRCDMessageFlag>, public Service
public:
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
unsigned GetParamCount() const;
virtual bool Run(MessageSource &, const std::vector<Anope::string> &params) = 0;
virtual void Run(MessageSource &, const std::vector<Anope::string> &params) = 0;
};
extern CoreExport IRCDProto *IRCD;