Changeset 5bcf70a for protocols/jabber


Ignore:
Timestamp:
2006-09-21T18:44:34Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
deff040
Parents:
4a0614e
Message:

Now also sending <presence type="unavailable"/> tag on disconnect, as
recommended by rfc3921/5.1.5.

Location:
protocols/jabber
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    r4a0614e r5bcf70a  
    235235}
    236236
    237 gboolean jabber_end_stream( struct gaim_connection *gc )
    238 {
    239         struct jabber_data *jd = gc->proto_data;
    240         char eos[] = "</stream:stream>";
     237void jabber_end_stream( struct gaim_connection *gc )
     238{
     239        struct jabber_data *jd = gc->proto_data;
    241240       
    242241        /* Let's only do this if the queue is currently empty, otherwise it'd
    243242           take too long anyway. */
    244         if( jd->tx_len > 0 )
    245                 return TRUE;
    246         else
    247                 return jabber_write( gc, eos, strlen( eos ) );
    248 }
     243        if( jd->tx_len == 0 )
     244        {
     245                char eos[] = "</stream:stream>";
     246                struct xt_node *node;
     247                int st;
     248               
     249                node = jabber_make_packet( "presence", "unavailable", NULL, NULL );
     250                st = jabber_write_packet( gc, node );
     251                xt_free_node( node );
     252               
     253                if( st )
     254                        jabber_write( gc, eos, strlen( eos ) );
     255        }
     256}
  • protocols/jabber/jabber.h

    r4a0614e r5bcf70a  
    5757gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond );
    5858gboolean jabber_start_stream( struct gaim_connection *gc );
    59 gboolean jabber_end_stream( struct gaim_connection *gc );
     59void jabber_end_stream( struct gaim_connection *gc );
    6060
    6161struct jabber_data
Note: See TracChangeset for help on using the changeset viewer.