aboutsummaryrefslogtreecommitdiffstats
path: root/include/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-06-17 15:37:26 +0100
committerGravatar Sadie Powell2026-06-17 15:39:58 +0100
commit33ab04fef638ab7fb6ec2eeea983b58c7e96c02f (patch)
tree6bd4da6a42df3deff3a7f955f56fa22c88f6a6f4 /include/modules
parentMerge branch 'insp4' into master. (diff)
parentAllow an event hook for after messages are sent to a client. (diff)
Merge branch 'insp4' into master.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/isupport.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/modules/isupport.h b/include/modules/isupport.h
index 88bb0ce87..b94ef4cc6 100644
--- a/include/modules/isupport.h
+++ b/include/modules/isupport.h
@@ -21,6 +21,8 @@
namespace ISupport
{
+ class API;
+ class APIBase;
class EventListener;
class EventProvider;
@@ -34,6 +36,33 @@ enum
RPL_ISUPPORT = 5,
};
+/** Defines the interface for the ISupport API. */
+class ISupport::APIBase
+ : public Service::SimpleProvider
+{
+public:
+ APIBase(const WeakModulePtr& mod)
+ : Service::SimpleProvider(mod, "isupportapi")
+ {
+ }
+
+ /** Sends a full ISupport numeric set to the specified user.
+ * @param user The user to send to.
+ */
+ virtual void SendTo(LocalUser* user) = 0;
+};
+
+/** Allows modules to send ISupport messages to users. */
+class ISupport::API final
+ : public dynamic_reference<ISupport::APIBase>
+{
+public:
+ API(const WeakModulePtr& mod)
+ : dynamic_reference<ISupport::APIBase>(mod, "isupportapi")
+ {
+ }
+};
+
class ISupport::EventListener
: public Events::ModuleEventListener
{
@@ -47,6 +76,10 @@ public:
virtual void OnBuildISupport(TokenMap& tokens) { }
virtual void OnBuildClassISupport(const std::shared_ptr<ConnectClass>& klass, TokenMap& tokens) { }
virtual void OnBuildOperISupport(LocalUser* user, TokenMap& tokens) { }
+ virtual ModResult OnSendISupportDiff(LocalUser* user, const TokenMap& tokens)
+ {
+ return MOD_RES_PASSTHRU;
+ }
};
class ISupport::EventProvider final