aboutsummaryrefslogtreecommitdiffstats
path: root/irc_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-07-14 00:14:41 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-07-14 00:14:41 +0100
commit324c378cd2d3f208b000e1279d462665d163edb7 (patch)
tree833fd206bdc7caffcf260e6ee12d03f6fcfec120 /irc_commands.c
parentb1af3e8750e81869c8c1d2a12c9c27f6913aa58d (diff)
Move control channel autoconfiguration to irc_cmd_join() instead so that it
only triggers on channels created by the user. (And not at identify time, which was causing odd problems on my test setup.)
Diffstat (limited to 'irc_commands.c')
-rw-r--r--irc_commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/irc_commands.c b/irc_commands.c
index d11d46d3..0bf20cfc 100644
--- a/irc_commands.c
+++ b/irc_commands.c
@@ -140,7 +140,31 @@ static void irc_cmd_join( irc_t *irc, char **cmd )
*comma = '\0';
if( ( ic = irc_channel_by_name( irc, s ) ) == NULL )
+ {
ic = irc_channel_new( irc, s );
+
+ if( strcmp( set_getstr( &ic->set, "type" ), "control" ) != 0 )
+ {
+ /* Autoconfiguration is for control channels only ATM. */
+ }
+ else if( bee_group_by_name( ic->irc->b, ic->name + 1, FALSE ) )
+ {
+ set_setstr( &ic->set, "group", ic->name + 1 );
+ set_setstr( &ic->set, "fill_by", "group" );
+ }
+ else if( set_setstr( &ic->set, "protocol", ic->name + 1 ) )
+ {
+ set_setstr( &ic->set, "fill_by", "protocol" );
+ }
+ else if( set_setstr( &ic->set, "account", ic->name + 1 ) )
+ {
+ set_setstr( &ic->set, "fill_by", "account" );
+ }
+ else
+ {
+ bee_irc_channel_update( ic->irc, ic, NULL );
+ }
+ }
if( ic == NULL )
{