diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-26 23:04:35 -0400 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-26 23:04:35 -0400 |
commit | b9e020af6c6a88392caa9edd120fb576ec971430 (patch) | |
tree | 988a1e51f7eac10d9b17cdf369fdd24e2797c553 /irc_channel.c | |
parent | 4be823968d7f4cb1d11e4f6dda50ef606a0fd7b0 (diff) |
Added JOIN, NAMES and PART commands.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index 3db01ee5..17904d72 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -44,6 +44,21 @@ irc_channel_t *irc_channel_new( irc_t *irc, const char *name ) return ic; } +irc_channel_t *irc_channel_by_name( irc_t *irc, const char *name ) +{ + GSList *l; + + for( l = irc->channels; l; l = l->next ) + { + irc_channel_t *ic = l->data; + + if( name[0] == ic->name[0] && nick_cmp( name + 1, ic->name + 1 ) == 0 ) + return ic; + } + + return NULL; +} + int irc_channel_add_user( irc_channel_t *ic, irc_user_t *iu ) { if( g_slist_find( ic->users, iu ) != NULL ) |