summaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-07-19 14:12:13 +0100
committerPeter Powell <petpow@saberuk.com>2019-07-19 14:17:10 +0100
commite2fcf7b3b15f86fec250b7b784bdf3d0631048c6 (patch)
treec0fea58c832b87abd3f5be1f920aaa5bfff475aa /include/modules
parenta9989ac3978bd6e1f9e915aeed399d9db327c235 (diff)
Add an event for adding tags to S2S messages.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/server.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/modules/server.h b/include/modules/server.h
index 6bd10b3e3..259da868f 100644
--- a/include/modules/server.h
+++ b/include/modules/server.h
@@ -25,6 +25,7 @@ namespace ServerProtocol
{
class BroadcastEventListener;
class LinkEventListener;
+ class MessageEventListener;
class SyncEventListener;
}
@@ -66,6 +67,30 @@ class ServerProtocol::LinkEventListener
virtual void OnServerSplit(const Server* server) { }
};
+class ServerProtocol::MessageEventListener
+ : public Events::ModuleEventListener
+{
+ public:
+ MessageEventListener(Module* mod)
+ : ModuleEventListener(mod, "event/server-message")
+ {
+ }
+
+ /** Fired when a server message is being sent by a user.
+ * @param source The user who sent the message.
+ * @param name The name of the command which was sent.
+ * @param tags The tags which will be sent with the message.
+ */
+ virtual void OnBuildMessage(User* source, const char* name, ClientProtocol::TagMap& tags) { }
+
+ /** Fired when a server message is being sent by a server.
+ * @param source The server who sent the message.
+ * @param name The name of the command which was sent.
+ * @param tags The tags which will be sent with the message.
+ */
+ virtual void OnBuildMessage(Server* source, const char* name, ClientProtocol::TagMap& tags) { }
+};
+
class ServerProtocol::SyncEventListener
: public Events::ModuleEventListener
{