From 27912fd4ff61af3b5c90daf0b6cdb3ac75cfef09 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 16 Dec 2010 00:09:29 -0600 Subject: [PATCH] Add send_channel_join(). --- include/channel.h | 2 ++ src/channel.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/channel.h b/include/channel.h index 6e4f70d9..80f7c0fb 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 308bd32a..92d36512 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() *