Changeset bb839e8 for protocols/msn/ns.c


Ignore:
Timestamp:
2010-04-10T01:05:39Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
efbc154
Parents:
9bf2481
Message:

Be more clever with keepalives; detect when a switchboard is opened with
someone who's offline already. Still a hack but it eases the pain a little
bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r9bf2481 rbb839e8  
    436436        else if( strcmp( cmd[0], "FLN" ) == 0 )
    437437        {
    438                 struct msn_switchboard *sb;
    439                
    440438                if( cmd[1] == NULL )
    441439                        return 1;
     
    443441                imcb_buddy_status( ic, cmd[1], 0, NULL, NULL );
    444442               
    445                 if( ( sb = msn_sb_by_handle( ic, cmd[1] ) ) &&
    446                     set_getbool( &ic->acc->set, "switchboard_keepalives" ) &&
    447                     sb->keepalive == 0 )
    448                 {
    449                         msn_sb_keepalive( sb, 0, 0 );
    450                         sb->keepalive = b_timeout_add( 20000, msn_sb_keepalive, sb );
    451                 }
     443                msn_sb_start_keepalives( msn_sb_by_handle( ic, cmd[1] ), TRUE );
    452444        }
    453445        else if( strcmp( cmd[0], "NLN" ) == 0 )
    454446        {
    455447                const struct msn_away_state *st;
    456                 struct msn_switchboard *sb;
    457448               
    458449                if( num_parts != 5 )
     
    477468                                   st->name, NULL );
    478469               
    479                 if( ( sb = msn_sb_by_handle( ic, cmd[1] ) ) && sb->keepalive > 0 )
    480                 {
    481                         b_event_remove( sb->keepalive );
    482                         sb->keepalive = 0;
    483                 }
     470                msn_sb_stop_keepalives( msn_sb_by_handle( ic, cmd[2] ) );
    484471        }
    485472        else if( strcmp( cmd[0], "RNG" ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.