diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-10 02:05:39 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-10 02:05:39 +0100 |
commit | bb839e8ae5b6228f9dcd8dda96b4e3ac5c0f63ba (patch) | |
tree | 009de5eb7fa9e3e495ab0b3f13b97eee9b0d9ac8 /protocols/msn/ns.c | |
parent | 9bf248155cb870be9dce921d58c905f5a5c1dad3 (diff) |
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.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r-- | protocols/msn/ns.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 1f6f8c74..4056bad7 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -435,25 +435,16 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) } else if( strcmp( cmd[0], "FLN" ) == 0 ) { - struct msn_switchboard *sb; - if( cmd[1] == NULL ) return 1; imcb_buddy_status( ic, cmd[1], 0, NULL, NULL ); - if( ( sb = msn_sb_by_handle( ic, cmd[1] ) ) && - set_getbool( &ic->acc->set, "switchboard_keepalives" ) && - sb->keepalive == 0 ) - { - msn_sb_keepalive( sb, 0, 0 ); - sb->keepalive = b_timeout_add( 20000, msn_sb_keepalive, sb ); - } + msn_sb_start_keepalives( msn_sb_by_handle( ic, cmd[1] ), TRUE ); } else if( strcmp( cmd[0], "NLN" ) == 0 ) { const struct msn_away_state *st; - struct msn_switchboard *sb; if( num_parts != 5 ) { @@ -476,11 +467,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) ( st != msn_away_state_list ? OPT_AWAY : 0 ), st->name, NULL ); - if( ( sb = msn_sb_by_handle( ic, cmd[1] ) ) && sb->keepalive > 0 ) - { - b_event_remove( sb->keepalive ); - sb->keepalive = 0; - } + msn_sb_stop_keepalives( msn_sb_by_handle( ic, cmd[2] ) ); } else if( strcmp( cmd[0], "RNG" ) == 0 ) { |