2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
5 #ifndef INCLUDED_HOOK_H
6 #define INCLUDED_HOOK_H
24 /* for idle time privacy features */
25 enum whois_idle_approval
32 typedef void (*hookfn
) (void *data
);
34 extern int h_iosend_id
;
35 extern int h_iorecv_id
;
36 extern int h_iorecvctrl_id
;
38 extern int h_burst_client
;
39 extern int h_burst_channel
;
40 extern int h_burst_finished
;
41 extern int h_server_introduced
;
42 extern int h_server_eob
;
43 extern int h_client_exit
;
44 extern int h_after_client_exit
;
45 extern int h_umode_changed
;
46 extern int h_new_local_user
;
47 extern int h_new_remote_user
;
48 extern int h_introduce_client
;
49 extern int h_can_kick
;
50 extern int h_privmsg_channel
;
51 extern int h_privmsg_user
;
52 extern int h_conf_read_start
;
53 extern int h_conf_read_end
;
54 extern int h_outbound_msgbuf
;
56 extern int h_priv_change
;
57 extern int h_cap_change
;
60 int register_hook(const char *name
);
61 void add_hook(const char *name
, hookfn fn
);
62 void add_hook_prio(const char *name
, hookfn fn
, enum hook_priority priority
);
63 void remove_hook(const char *name
, hookfn fn
);
64 void call_hook(int id
, void *arg
);
68 struct Client
*client
;
75 struct Client
*client
;
82 struct Client
*client
;
90 struct Client
*client
;
91 struct Client
*target
;
96 struct Client
*client
;
97 struct Channel
*chptr
;
103 struct Client
*client
;
104 struct Channel
*chptr
;
106 } hook_data_channel_activity
;
110 struct Client
*client
;
111 struct Channel
*chptr
;
112 struct membership
*msptr
;
113 struct Client
*target
;
118 } hook_data_channel_approval
;
122 struct Client
*client
;
123 struct Client
*target
;
124 struct Channel
*chptr
;
125 struct membership
*clientms
;
126 struct membership
*targetms
;
128 } hook_data_channel_visibility
;
132 struct Client
*client
;
133 struct Client
*target
;
135 } hook_data_client_approval
;
139 struct Client
*local_link
; /* local client originating this, or NULL */
140 struct Client
*target
; /* dying client */
141 struct Client
*from
; /* causing client (could be &me or target) */
143 } hook_data_client_exit
;
147 struct Client
*client
;
149 const char *orig_reason
;
150 } hook_data_client_quit
;
154 struct Client
*client
;
155 unsigned int oldumodes
;
156 unsigned int oldsnomask
;
157 } hook_data_umode_changed
;
161 struct Client
*client
;
165 } hook_data_cap_change
;
169 MESSAGE_TYPE_PRIVMSG
,
176 enum message_type msgtype
;
177 struct Client
*source_p
;
178 struct Channel
*chptr
;
181 } hook_data_privmsg_channel
;
185 enum message_type msgtype
;
186 struct Client
*source_p
;
187 struct Client
*target_p
;
190 } hook_data_privmsg_user
;
194 struct Client
*client
;
195 struct PrivilegeSet
*old
;
196 struct PrivilegeSet
*new;
197 const struct PrivilegeSet
*added
;
198 const struct PrivilegeSet
*removed
;
199 const struct PrivilegeSet
*unchanged
;
200 } hook_data_priv_change
;