diff options
Diffstat (limited to 'protocols/jabber/io.c')
| -rw-r--r-- | protocols/jabber/io.c | 20 | 
1 files changed, 14 insertions, 6 deletions
| diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index 8c0b239e..b11ef17d 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -234,15 +234,23 @@ gboolean jabber_start_stream( struct gaim_connection *gc )  	return st;  } -gboolean jabber_end_stream( struct gaim_connection *gc ) +void jabber_end_stream( struct gaim_connection *gc )  {  	struct jabber_data *jd = gc->proto_data; -	char eos[] = "</stream:stream>";  	/* Let's only do this if the queue is currently empty, otherwise it'd  	   take too long anyway. */ -	if( jd->tx_len > 0 ) -		return TRUE; -	else -		return jabber_write( gc, eos, strlen( eos ) ); +	if( jd->tx_len == 0 ) +	{ +		char eos[] = "</stream:stream>"; +		struct xt_node *node; +		int st; +		 +		node = jabber_make_packet( "presence", "unavailable", NULL, NULL ); +		st = jabber_write_packet( gc, node ); +		xt_free_node( node ); +		 +		if( st ) +			jabber_write( gc, eos, strlen( eos ) ); +	}  } | 
