diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/jabber/io.c | 20 | ||||
-rw-r--r-- | protocols/jabber/jabber.h | 2 |
2 files changed, 15 insertions, 7 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 ) ); + } } diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index 93e2baab..45747fcb 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -56,7 +56,7 @@ int jabber_write_packet( struct gaim_connection *gc, struct xt_node *node ); int jabber_write( struct gaim_connection *gc, char *buf, int len ); gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond ); gboolean jabber_start_stream( struct gaim_connection *gc ); -gboolean jabber_end_stream( struct gaim_connection *gc ); +void jabber_end_stream( struct gaim_connection *gc ); struct jabber_data { |