From ebe54bcf27771bb82eacc665ae088cb01ec82a4c Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Tue, 16 Aug 2011 15:11:15 +0200 Subject: [PATCH] Added plugin events for server wide events (mostly for logging). --- src/plugin_api/handle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugin_api/handle.h b/src/plugin_api/handle.h index f9004f0..d8198d8 100644 --- a/src/plugin_api/handle.h +++ b/src/plugin_api/handle.h @@ -51,6 +51,10 @@ struct plugin_user enum auth_credentials credentials; }; +struct plugin_hub_info +{ +}; + enum plugin_status { st_default = 0, /* Use default */ @@ -100,6 +104,11 @@ typedef void (*on_user_nick_change_t)(struct plugin_handle*, struct plugin_user* typedef void (*on_user_update_error_t)(struct plugin_handle*, struct plugin_user*, const char* reason); typedef void (*on_user_chat_msg_t)(struct plugin_handle*, struct plugin_user*, const char* message, int flags); +typedef void (*on_hub_started_t)(struct plugin_handle*, struct plugin_hub_info*); +typedef void (*on_hub_reloaded_t)(struct plugin_handle*, struct plugin_hub_info*); +typedef void (*on_hub_shutdown_t)(struct plugin_handle*, struct plugin_hub_info*); +typedef void (*on_hub_error_t)(struct plugin_handle*, struct plugin_hub_info*, const char* message); + typedef plugin_st (*on_change_nick_t)(struct plugin_handle*, struct plugin_user*, const char* new_nick); typedef plugin_st (*on_check_ip_early_t)(struct plugin_handle*, struct ip_addr_encap*); @@ -126,6 +135,12 @@ struct plugin_funcs on_user_update_error_t on_user_update_error;/* A user has failed to update - nickname, etc. */ on_user_chat_msg_t on_user_chat_message;/* A user has sent a public chat message */ + // Log hub events + on_hub_started_t on_hub_started; /* Triggered just after plugins are loaded and the hub is started. */ + on_hub_reloaded_t on_hub_reloaded; /* Triggered immediately after hub configuration is reloaded. */ + on_hub_shutdown_t on_hub_shutdown; /* Triggered just before the hub is being shut down and before plugins are unloaded. */ + on_hub_error_t on_hub_error; /* Triggered for log-worthy error messages */ + // Activity events (can be intercepted and refused/accepted by a plugin) on_chat_msg_t on_chat_msg; /* A public chat message is about to be sent (can be intercepted) */ on_private_msg_t on_private_msg; /* A public chat message is about to be sent (can be intercepted) */