Changeset f924563 for protocols/msn/sb.c
- Timestamp:
- 2010-05-03T00:52:08Z (14 years ago)
- Branches:
- master
- Children:
- 1a3ba05
- Parents:
- 6a9d068 (diff), 6824fb3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
r6a9d068 rf924563 175 175 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->acc->user ); 176 176 } 177 else if( strcmp( text, SB_KEEPALIVE_MESSAGE ) == 0 ) 178 { 179 buf = g_strdup( SB_KEEPALIVE_HEADERS ); 180 i = strlen( buf ); 181 } 177 182 else if( strncmp( text, MSN_INVITE_HEADERS, sizeof( MSN_INVITE_HEADERS ) - 1 ) == 0 ) 178 183 { … … 256 261 257 262 msn_msgq_purge( ic, &sb->msgq ); 263 msn_sb_stop_keepalives( sb ); 258 264 259 265 if( sb->key ) g_free( sb->key ); … … 477 483 478 484 sb->ready = 1; 485 486 msn_sb_start_keepalives( sb, FALSE ); 479 487 } 480 488 else if( strcmp( cmd[0], "CAL" ) == 0 ) … … 526 534 } 527 535 536 msn_sb_start_keepalives( sb, FALSE ); 537 528 538 return( st ); 529 539 } … … 587 597 if( sb->who ) 588 598 { 599 msn_sb_stop_keepalives( sb ); 600 589 601 /* This is a single-person chat, and the other person is leaving. */ 590 602 g_free( sb->who ); … … 752 764 return( 1 ); 753 765 } 766 767 static gboolean msn_sb_keepalive( gpointer data, gint source, b_input_condition cond ) 768 { 769 struct msn_switchboard *sb = data; 770 return sb->ready && msn_sb_sendmessage( sb, SB_KEEPALIVE_MESSAGE ); 771 } 772 773 void msn_sb_start_keepalives( struct msn_switchboard *sb, gboolean initial ) 774 { 775 bee_user_t *bu; 776 777 if( sb && sb->who && sb->keepalive == 0 && 778 ( bu = bee_user_by_handle( sb->ic->bee, sb->ic, sb->who ) ) && 779 !( bu->flags & BEE_USER_ONLINE ) && 780 set_getbool( &sb->ic->acc->set, "switchboard_keepalives" ) ) 781 { 782 if( initial ) 783 msn_sb_keepalive( sb, 0, 0 ); 784 785 sb->keepalive = b_timeout_add( 20000, msn_sb_keepalive, sb ); 786 } 787 } 788 789 void msn_sb_stop_keepalives( struct msn_switchboard *sb ) 790 { 791 if( sb && sb->keepalive > 0 ) 792 { 793 b_event_remove( sb->keepalive ); 794 sb->keepalive = 0; 795 } 796 }
Note: See TracChangeset
for help on using the changeset viewer.