]> jfr.im git - solanum.git/blobdiff - include/hook.h
Add +R channel mode module requiring services account to chat (#102)
[solanum.git] / include / hook.h
index 5d768c8d502c5b522940c9ded442a57ba905fb33..c9dcf93e207eb2eb9c16a74f439462cf786089e1 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
  * Copyright (C) 2004-2005 ircd-ratbox development team
- *
- * $Id: hook.h 906 2006-02-21 02:25:43Z nenolod $
  */
 #ifndef INCLUDED_HOOK_H
 #define INCLUDED_HOOK_H
@@ -13,6 +11,16 @@ typedef struct
        rb_dlink_list hooks;
 } hook;
 
+enum hook_priority
+{
+       HOOK_LOWEST = 10,
+       HOOK_LOW = 20,
+       HOOK_NORMAL = 30,
+       HOOK_HIGH = 40,
+       HOOK_HIGHEST = 50,
+       HOOK_MONITOR = 100
+};
+
 typedef void (*hookfn) (void *data);
 
 extern int h_iosend_id;
@@ -25,6 +33,7 @@ extern int h_burst_finished;
 extern int h_server_introduced;
 extern int h_server_eob;
 extern int h_client_exit;
+extern int h_after_client_exit;
 extern int h_umode_changed;
 extern int h_new_local_user;
 extern int h_new_remote_user;
@@ -34,33 +43,43 @@ extern int h_privmsg_channel;
 extern int h_privmsg_user;
 extern int h_conf_read_start;
 extern int h_conf_read_end;
+extern int h_outbound_msgbuf;
+extern int h_rehash;
+extern int h_cap_change;
 
 void init_hook(void);
 int register_hook(const char *name);
 void add_hook(const char *name, hookfn fn);
+void add_hook_prio(const char *name, hookfn fn, enum hook_priority priority);
 void remove_hook(const char *name, hookfn fn);
 void call_hook(int id, void *arg);
 
+typedef struct
+{
+       struct Client *client;
+       void *arg1;
+       void *arg2;
+} hook_data;
+
 typedef struct
 {
        struct Client *client;
        const void *arg1;
        const void *arg2;
-} hook_data;
+} hook_cdata;
 
 typedef struct
 {
        struct Client *client;
        const void *arg1;
        int arg2;
+       int result;
 } hook_data_int;
 
 typedef struct
 {
        struct Client *client;
        struct Client *target;
-       struct Channel *chptr;
-       int approved;
 } hook_data_client;
 
 typedef struct
@@ -74,7 +93,7 @@ typedef struct
 {
        struct Client *client;
        struct Channel *chptr;
-       char *key;
+       const char *key;
 } hook_data_channel_activity;
 
 typedef struct
@@ -86,8 +105,19 @@ typedef struct
        int approved;
        int dir;
        const char *modestr;
+       const char *error;
 } hook_data_channel_approval;
 
+typedef struct
+{
+       struct Client *client;
+       struct Client *target;
+       struct Channel *chptr;
+       struct membership *clientms;
+       struct membership *targetms;
+       int approved;
+} hook_data_channel_visibility;
+
 typedef struct
 {
        struct Client *client;
@@ -103,6 +133,13 @@ typedef struct
        const char *comment;
 } hook_data_client_exit;
 
+typedef struct
+{
+       struct Client *client;
+       const char *reason;
+       const char *orig_reason;
+} hook_data_client_quit;
+
 typedef struct
 {
        struct Client *client;
@@ -110,6 +147,14 @@ typedef struct
        unsigned int oldsnomask;
 } hook_data_umode_changed;
 
+typedef struct
+{
+       struct Client *client;
+       int oldcaps;
+       int add;
+       int del;
+} hook_data_cap_change;
+
 enum message_type {
        MESSAGE_TYPE_NOTICE,
        MESSAGE_TYPE_PRIVMSG,
@@ -135,4 +180,9 @@ typedef struct
        int approved;
 } hook_data_privmsg_user;
 
+typedef struct
+{
+       bool signal;
+} hook_data_rehash;
+
 #endif