1 /* IRCEvents.h - NeonServ v5.5
2 * Copyright (C) 2011-2012 Philipp Kreil (pk910)
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 void unregister_module_events(int module_id);
33 typedef void join_func_t(struct ChanUser *chanuser);
35 /* MODULAR ACCESSIBLE */ int bind_join(join_func_t *func, int module_id);
36 /* MODULAR ACCESSIBLE */ void unbind_join(join_func_t *func);
37 int event_join(struct ChanUser *chanuser);
40 typedef void nick_func_t(struct UserNode *user, char *new_nick);
42 /* MODULAR ACCESSIBLE */ int bind_nick(nick_func_t *func, int module_id);
43 /* MODULAR ACCESSIBLE */ void unbind_nick(nick_func_t *func);
44 int event_nick(struct UserNode *user, char *new_nick);
47 typedef void part_func_t(struct ChanUser *chanuser, int quit, char *reason);
49 /* MODULAR ACCESSIBLE */ int bind_part(part_func_t *func, int module_id);
50 /* MODULAR ACCESSIBLE */ void unbind_part(part_func_t *func);
51 int event_part(struct ChanUser *chanuser, int quit, char *reason);
54 typedef void kick_func_t(struct UserNode *user, struct ChanUser *target, char *reason);
56 /* MODULAR ACCESSIBLE */ int bind_kick(kick_func_t *func, int module_id);
57 /* MODULAR ACCESSIBLE */ void unbind_kick(kick_func_t *func);
58 int event_kick(struct UserNode *user, struct ChanUser *target, char *reason);
61 typedef void topic_func_t(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
63 /* MODULAR ACCESSIBLE */ int bind_topic(topic_func_t *func, int module_id);
64 /* MODULAR ACCESSIBLE */ void unbind_topic(topic_func_t *func);
65 int event_topic(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
68 typedef void mode_func_t(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
70 /* MODULAR ACCESSIBLE */ int bind_mode(mode_func_t *func, int module_id);
71 /* MODULAR ACCESSIBLE */ void unbind_mode(mode_func_t *func);
72 int event_mode(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
75 typedef void chanmsg_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
77 /* MODULAR ACCESSIBLE */ int bind_chanmsg(chanmsg_func_t *func, int module_id);
78 /* MODULAR ACCESSIBLE */ void unbind_chanmsg(chanmsg_func_t *func);
79 int event_chanmsg(struct UserNode *user, struct ChanNode *chan, char *message);
82 typedef void privmsg_func_t(struct UserNode *user, struct UserNode *target, char *message);
84 /* MODULAR ACCESSIBLE */ int bind_privmsg(privmsg_func_t *func, int module_id);
85 /* MODULAR ACCESSIBLE */ void unbind_privmsg(privmsg_func_t *func);
86 int event_privmsg(struct UserNode *user, struct UserNode *target, char *message);
89 typedef void channotice_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
91 /* MODULAR ACCESSIBLE */ int bind_channotice(channotice_func_t *func, int module_id);
92 /* MODULAR ACCESSIBLE */ void unbind_channotice(channotice_func_t *func);
93 int event_channotice(struct UserNode *user, struct ChanNode *chan, char *message);
96 typedef void privnotice_func_t(struct UserNode *user, struct UserNode *target, char *message);
98 /* MODULAR ACCESSIBLE */ int bind_privnotice(privnotice_func_t *func, int module_id);
99 /* MODULAR ACCESSIBLE */ void unbind_privnotice(privnotice_func_t *func);
100 int event_privnotice(struct UserNode *user, struct UserNode *target, char *message);
103 typedef void chanctcp_func_t(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
104 #ifndef DND_FUNCTIONS
105 /* MODULAR ACCESSIBLE */ int bind_chanctcp(chanctcp_func_t *func, int module_id);
106 /* MODULAR ACCESSIBLE */ void unbind_chanctcp(chanctcp_func_t *func);
107 int event_chanctcp(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
110 typedef void privctcp_func_t(struct UserNode *user, struct UserNode *target, char *command, char *text);
111 #ifndef DND_FUNCTIONS
112 /* MODULAR ACCESSIBLE */ int bind_privctcp(privctcp_func_t *func, int module_id);
113 /* MODULAR ACCESSIBLE */ void unbind_privctcp(privctcp_func_t *func);
114 int event_privctcp(struct UserNode *user, struct UserNode *target, char *command, char *text);
117 typedef void invite_func_t(struct ClientSocket *client, struct UserNode *user, char *channel);
118 #ifndef DND_FUNCTIONS
119 /* MODULAR ACCESSIBLE */ int bind_invite(invite_func_t *func, int module_id);
120 /* MODULAR ACCESSIBLE */ void unbind_invite(invite_func_t *func);
121 int event_invite(struct ClientSocket *client, struct UserNode *user, char *channel);
124 typedef void raw_func_t(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
125 #ifndef DND_FUNCTIONS
126 /* MODULAR ACCESSIBLE */ int bind_raw(raw_func_t *func, int module_id);
127 /* MODULAR ACCESSIBLE */ void unbind_raw(raw_func_t *func);
128 int event_raw(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
131 typedef void bot_ready_func_t(struct ClientSocket *client);
132 #ifndef DND_FUNCTIONS
133 /* MODULAR ACCESSIBLE */ int bind_bot_ready(bot_ready_func_t *func, int module_id);
134 /* MODULAR ACCESSIBLE */ void unbind_bot_ready(bot_ready_func_t *func);
135 int event_bot_ready(struct ClientSocket *client);
138 typedef void registered_func_t(struct UserNode *user, char *new_mask);
139 #ifndef DND_FUNCTIONS
140 /* MODULAR ACCESSIBLE */ int bind_registered(registered_func_t *func, int module_id);
141 /* MODULAR ACCESSIBLE */ void unbind_registered(registered_func_t *func);
142 int event_registered(struct UserNode *user, char *new_mask);
145 typedef int freeuser_func_t(struct UserNode *user);
146 #ifndef DND_FUNCTIONS
147 /* MODULAR ACCESSIBLE */ int bind_freeuser(freeuser_func_t *func, int module_id);
148 /* MODULAR ACCESSIBLE */ void unbind_freeuser(freeuser_func_t *func);
149 int event_freeuser(struct UserNode *user);
152 typedef int freechan_func_t(struct ChanNode *chan);
153 #ifndef DND_FUNCTIONS
154 /* MODULAR ACCESSIBLE */ int bind_freechan(freechan_func_t *func, int module_id);
155 /* MODULAR ACCESSIBLE */ void unbind_freechan(freechan_func_t *func);
156 int event_freechan(struct ChanNode *chan);