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.

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.