diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-09 18:20:51 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-09 18:20:51 +0100 |
commit | 9ac3ed11de72046c318398481603c6680af37cf2 (patch) | |
tree | 8aa82760176daf345f8bed85a8ff06299a322191 /irc_channel.c | |
parent | dcd16c5f8b8788d476bf4193701fc61656dfbf14 (diff) |
First bits for different channel types.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index 528d0442..e6570f4c 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -53,6 +53,13 @@ irc_channel_t *irc_channel_new( irc_t *irc, const char *name ) else /* if( name[0] == '#' ) */ ic->f = &groupchat_stub_funcs; + if( ic->f->_init ) + if( !ic->f->_init( ic ) ) + { + irc_channel_free( ic ); + return NULL; + } + return ic; } @@ -248,8 +255,24 @@ static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) return TRUE; } +static gboolean control_channel_init( irc_channel_t *ic ) +{ + struct irc_control_channel *icc; + + ic->data = icc = g_new0( struct irc_control_channel, 1 ); + icc->type = IRC_CC_TYPE_DEFAULT; + + return TRUE; +} + static const struct irc_channel_funcs control_channel_funcs = { control_channel_privmsg, + NULL, + NULL, + NULL, + NULL, + + control_channel_init, }; /* Groupchat stub: Only handles /INVITE at least for now. */ |