aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-27 13:36:47 -0400
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-27 13:36:47 -0400
commit280c56a7b24dc08b35a1ecd98c8f4b61435d1100 (patch)
tree81340377a433898775385ee070beea1e4ea5e65b /irc_channel.c
parent2f53ada73d7d43b538c157563ab5eb39b7592137 (diff)
Added privmsg handlers to users/channels. root commands are coming back.
Diffstat (limited to 'irc_channel.c')
-rw-r--r--irc_channel.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c
index c2e2c685..ec0433c1 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -25,6 +25,8 @@
#include "bitlbee.h"
+static const struct irc_channel_funcs control_channel_funcs;
+
irc_channel_t *irc_channel_new( irc_t *irc, const char *name )
{
irc_channel_t *ic;
@@ -33,6 +35,7 @@ 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 );
@@ -131,3 +134,15 @@ gboolean irc_channel_name_ok( const char *name )
{
return strchr( CTYPES, name[0] ) != NULL && nick_ok( name + 1 );
}
+
+/* Channel-type dependent functions, for control channels: */
+static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg )
+{
+ root_command_string( ic->irc, msg );
+
+ return TRUE;
+}
+
+static const struct irc_channel_funcs control_channel_funcs = {
+ control_channel_privmsg,
+};