diff --git a/include/channel.h b/include/channel.h index 6e4f70d93..80f7c0fbb 100644 --- a/include/channel.h +++ b/include/channel.h @@ -281,4 +281,6 @@ const char * get_extban_string(void); extern int get_channel_access(struct Client *source_p, struct membership *msptr); +extern void send_channel_join(struct Channel *chptr, struct Client *client_p); + #endif /* INCLUDED_channel_h */ diff --git a/src/channel.c b/src/channel.c index 308bd32a7..92d365125 100644 --- a/src/channel.c +++ b/src/channel.c @@ -123,6 +123,22 @@ free_ban(struct Ban *bptr) rb_bh_free(ban_heap, bptr); } +/* + * send_channel_join() + * + * input - channel to join, client joining. + * output - none + * side effects - none + */ +void +send_channel_join(struct Channel *chptr, struct Client *client_p) +{ + if (!IsClient(client_p)) + return; + + sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s", + client_p->name, client_p->username, client_p->host, chptr->chname); +} /* find_channel_membership() *