diff options
| -rw-r--r-- | irc_channel.c | 18 | ||||
| -rw-r--r-- | irc_commands.c | 24 | 
2 files changed, 24 insertions, 18 deletions
| diff --git a/irc_channel.c b/irc_channel.c index 70770bfb..6f9de637 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -548,24 +548,6 @@ static gboolean control_channel_init( irc_channel_t *ic )  	ic->data = icc = g_new0( struct irc_control_channel, 1 );  	icc->type = IRC_CC_TYPE_DEFAULT; -	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 ); -	} -	  	return TRUE;  } 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 )  		{ | 
