aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'irc_channel.c')
-rw-r--r--irc_channel.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 2ff00068..2c6601d2 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -27,6 +27,7 @@
static gint irc_channel_user_cmp( gconstpointer a_, gconstpointer b_ );
static const struct irc_channel_funcs control_channel_funcs;
+static const struct irc_channel_funcs groupchat_stub_funcs;
irc_channel_t *irc_channel_new( irc_t *irc, const char *name )
{
@@ -36,7 +37,6 @@ irc_channel_t *irc_channel_new( irc_t *irc, const char *name )
return NULL;
ic = g_new0( irc_channel_t, 1 );
- ic->f = &control_channel_funcs;
ic->irc = irc;
ic->name = g_strdup( name );
strcpy( ic->mode, CMODE );
@@ -48,6 +48,11 @@ irc_channel_t *irc_channel_new( irc_t *irc, const char *name )
irc->channels = g_slist_prepend( irc->channels, ic );
+ if( name[0] == '&' )
+ ic->f = &control_channel_funcs;
+ else /* if( name[0] == '#' ) */
+ ic->f = &groupchat_stub_funcs;
+
return ic;
}
@@ -250,3 +255,30 @@ static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg )
static const struct irc_channel_funcs control_channel_funcs = {
control_channel_privmsg,
};
+
+/* Groupchat stub: Only handles /INVITE at least for now. */
+static gboolean groupchat_stub_invite( irc_channel_t *ic, irc_user_t *iu )
+{
+ bee_user_t *bu = iu->bu;
+
+ if( iu->bu->ic->acc->prpl->chat_with )
+ {
+ ic->flags |= IRC_CHANNEL_CHAT_PICKME;
+ iu->bu->ic->acc->prpl->chat_with( bu->ic, bu->handle );
+ ic->flags &= ~IRC_CHANNEL_CHAT_PICKME;
+ return TRUE;
+ }
+ else
+ {
+ irc_send_num( ic->irc, 482, "%s :IM protocol does not support room invitations", ic->name );
+ return FALSE;
+ }
+}
+
+static const struct irc_channel_funcs groupchat_stub_funcs = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ groupchat_stub_invite,
+};