diff --git a/src/mod/channels.mod/tclchan.c b/src/mod/channels.mod/tclchan.c index f40f9f8d2..e4b7f6ff7 100644 --- a/src/mod/channels.mod/tclchan.c +++ b/src/mod/channels.mod/tclchan.c @@ -2009,6 +2009,7 @@ static void init_channel(struct chanset_t *chan, int reset) chan->channel.member = nmalloc(sizeof *chan->channel.member); /* Since we don't have channel_malloc, manually bzero */ egg_bzero(chan->channel.member, sizeof *chan->channel.member); + do_hook_reset_member(); } if (flags & CHAN_RESETMODES) { diff --git a/src/mod/module.h b/src/mod/module.h index da1651c0a..425d392a8 100644 --- a/src/mod/module.h +++ b/src/mod/module.h @@ -526,6 +526,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr #define argv0 ((char *)global[322]) #define get_user_from_member ((struct userrec * (*)(memberlist *))global[323]) /* 324 - 327 */ +#define do_hook_reset_member ((void (*) ())global[324]) /* hostmasking */ diff --git a/src/mod/modvals.h b/src/mod/modvals.h index 6b955cad3..f9ad3c05f 100644 --- a/src/mod/modvals.h +++ b/src/mod/modvals.h @@ -39,7 +39,8 @@ #define HOOK_LOADED 13 #define HOOK_BACKUP 14 #define HOOK_DIE 15 -#define REAL_HOOKS 16 +#define HOOK_RESET_MEMBER 16 +#define REAL_HOOKS 17 #define HOOK_SHAREOUT 105 #define HOOK_SHAREIN 106 #define HOOK_ENCRYPT_PASS 107 diff --git a/src/modules.c b/src/modules.c index 61ae64716..71147074f 100644 --- a/src/modules.c +++ b/src/modules.c @@ -176,6 +176,7 @@ int (*rfc_toupper) (int) = _rfc_toupper; int (*rfc_tolower) (int) = _rfc_tolower; void (*dns_hostbyip) (sockname_t *) = core_dns_hostbyip; void (*dns_ipbyhost) (char *) = core_dns_ipbyhost; +void (*hook_reset_member) () = null_func; module_entry *module_list; dependancy *dependancy_list = NULL; @@ -627,8 +628,9 @@ Function global_table[] = { (Function) bind_bind_entry, (Function) unbind_bind_entry, (Function) & argv0, - (Function) get_user_from_member + (Function) get_user_from_member, /* 324 - 327 */ + (Function) do_hook_reset_member }; void init_modules(void) @@ -1211,3 +1213,7 @@ void do_module_report(int idx, int details, char *which) if (which) dprintf(idx, "No such module.\n"); } + +void do_hook_reset_member() { + call_hook(HOOK_RESET_MEMBER); +} diff --git a/src/modules.h b/src/modules.h index 839d5e87f..225119b9c 100644 --- a/src/modules.h +++ b/src/modules.h @@ -46,6 +46,7 @@ void mod_free(void *, const char *, const char *, int); void add_hook(int, Function); void del_hook(int, Function); void *get_next_hook(int, void *); +void do_hook_reset_member(); extern struct hook_entry { struct hook_entry *next;