diff --git a/src/channel.c b/src/channel.c index 6151ec7e..004c6fbf 100644 --- a/src/channel.c +++ b/src/channel.c @@ -62,6 +62,7 @@ static struct ChCapCombo chcap_combos[NCHCAP_COMBOS]; static void free_topic(struct Channel *chptr); static int h_can_join; +int h_get_channel_access; /* init_channels() * @@ -78,6 +79,7 @@ init_channels(void) member_heap = rb_bh_create(sizeof(struct membership), MEMBER_HEAP_SIZE, "member_heap"); h_can_join = register_hook("can_join"); + h_get_channel_access = register_hook("get_channel_access"); } /* diff --git a/src/chmode.c b/src/chmode.c index 559ba7b5..9e143245 100644 --- a/src/chmode.c +++ b/src/chmode.c @@ -71,6 +71,8 @@ char cflagsmyinfo[256]; int chmode_flags[256]; +extern int h_get_channel_access; + /* OPTIMIZE ME! -- dwr */ void construct_cflags_strings(void) @@ -187,10 +189,20 @@ cflag_orphan(char c_) static int get_channel_access(struct Client *source_p, struct membership *msptr) { - if(!MyClient(source_p) || is_chanop(msptr)) + hook_data_channel_approval moduledata; + + if(!MyClient(source_p)) return CHFL_CHANOP; - return CHFL_PEON; + moduledata.client = source_p; + moduledata.chptr = msptr->chptr; + moduledata.msptr = msptr; + moduledata.target = NULL; + moduledata.approved = is_chanop(msptr) ? CHFL_CHANOP : CHFL_PEON; + + call_hook(h_get_channel_access, &moduledata); + + return moduledata.approved; } /* add_id()