diff options
| -rw-r--r-- | doc/user-guide/commands.xml | 10 | ||||
| -rw-r--r-- | irc.c | 3 | ||||
| -rw-r--r-- | protocols/nogaim.c | 16 | 
3 files changed, 26 insertions, 3 deletions
| diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 6646d0db..cf40782f 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -595,6 +595,16 @@  		</description>  	</bitlbee-setting> +	<bitlbee-setting name="simulate_netsplit" type="boolean" scope="global"> +		<default>true</default> + +		<description> +			<para> +				Some IRC clients parse quit messages sent by the IRC server to see if someone really left or just disappeared because of a netsplit. By default, BitlBee tries to simulate netsplit-like quit messages to keep the control channel window clean. If you don't like this (or if your IRC client doesn't support this) you can disable this setting. +			</para> +		</description> +	</bitlbee-setting> +  	<bitlbee-setting name="ssl" type="boolean" scope="account">  		<default>false</default> @@ -142,6 +142,7 @@ irc_t *irc_new( int fd )  	set_add( &irc->set, "private", "true", set_eval_bool, irc );  	set_add( &irc->set, "query_order", "lifo", NULL, irc );  	set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc ); +	set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );  	set_add( &irc->set, "strip_html", "true", NULL, irc );  	set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc );  	set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc ); @@ -909,7 +910,7 @@ void irc_kill( irc_t *irc, user_t *u )  	char *nick, *s;  	char reason[128]; -	if( u->ic && u->ic->flags & OPT_LOGGING_OUT ) +	if( u->ic && u->ic->flags & OPT_LOGGING_OUT && set_getbool( &irc->set, "simulate_netsplit" ) )  	{  		if( u->ic->acc->server )  			g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost, diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 9ebd048e..d7b26b74 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -585,8 +585,20 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags,  	    ( ( ( u->online != oo ) && !u->away ) ||			/* Voice joining people */  	      ( ( u->online == oo ) && ( oa == !u->away ) ) ) )		/* (De)voice people changing state */  	{ -		irc_write( ic->irc, ":%s MODE %s %cv %s", ic->irc->myhost, -		                                          ic->irc->channel, u->away?'-':'+', u->nick ); +		char *from; +		 +		if( set_getbool( &ic->irc->set, "simulate_netsplit" ) ) +		{ +			from = g_strdup( ic->irc->myhost ); +		} +		else +		{ +			from = g_strdup_printf( "%s!%s@%s", ic->irc->mynick, ic->irc->mynick, +			                                    ic->irc->myhost ); +		} +		irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, +		                                          u->away?'-':'+', u->nick ); +		g_free( from );  	}  } | 
