Changeset 46dca11 for protocols/msn
- Timestamp:
- 2008-01-06T12:32:27Z (17 years ago)
- Branches:
- master
- Children:
- 43462708
- Parents:
- 1febf5c
- Location:
- protocols/msn
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r1febf5c r46dca11 90 90 msn_sb_destroy( md->switchboards->data ); 91 91 92 if( md->msgq ) 93 { 94 struct msn_message *m; 95 96 for( l = md->msgq; l; l = l->next ) 97 { 98 m = l->data; 99 100 imcb_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 101 g_free( m->who ); 102 g_free( m->text ); 103 g_free( m ); 104 } 105 g_slist_free( md->msgq ); 106 } 92 msn_msgq_purge( ic, &md->msgq ); 107 93 108 94 while( md->groupcount > 0 ) -
protocols/msn/msn.h
r1febf5c r46dca11 158 158 int msn_handler( struct msn_handler_data *h ); 159 159 char *msn_http_encode( const char *input ); 160 void msn_msgq_purge( struct im_connection *ic, GSList **list ); 160 161 161 162 /* tables.c */ -
protocols/msn/msn_util.c
r1febf5c r46dca11 339 339 return ret; 340 340 } 341 342 void msn_msgq_purge( struct im_connection *ic, GSList **list ) 343 { 344 struct msn_message *m; 345 GString *ret; 346 GSList *l; 347 348 l = *list; 349 if( l == NULL ) 350 return; 351 352 m = l->data; 353 ret = g_string_sized_new( 1024 ); 354 g_string_printf( ret, "WARNING: Cleaning up MSN (switchboard) connection with unsent " 355 "messages to %s:", m->who ? m->who : "unknown recipient" ); 356 357 while( l ) 358 { 359 m = l->data; 360 361 g_string_append_printf( ret, "\n%s", m->text ); 362 363 g_free( m->who ); 364 g_free( m->text ); 365 g_free( m ); 366 367 l = l->next; 368 } 369 g_slist_free( *list ); 370 *list = NULL; 371 372 imcb_log( ic, ret->str ); 373 g_string_free( ret, TRUE ); 374 } -
protocols/msn/sb.c
r1febf5c r46dca11 128 128 if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 ) 129 129 { 130 buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 );130 buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 + 1 ); 131 131 i = strlen( MSN_MESSAGE_HEADERS ); 132 132 … … 207 207 debug( "Destroying switchboard: %s", sb->who ? sb->who : sb->key ? sb->key : "" ); 208 208 209 if( sb->msgq ) 210 { 211 struct msn_message *m; 212 GSList *l; 213 214 for( l = sb->msgq; l; l = l->next ) 215 { 216 m = l->data; 217 218 g_free( m->who ); 219 g_free( m->text ); 220 g_free( m ); 221 } 222 g_slist_free( sb->msgq ); 223 224 imcb_log( ic, "Warning: Closing down MSN switchboard connection with " 225 "unsent message to %s, you'll have to resend it.", 226 sb->who ? sb->who : "(unknown)" ); 227 } 209 msn_msgq_purge( ic, &sb->msgq ); 228 210 229 211 if( sb->key ) g_free( sb->key ); … … 266 248 if( source != sb->fd ) 267 249 { 268 debug( "E RROR%d while connecting to switchboard server", 1 );250 debug( "Error %d while connecting to switchboard server", 1 ); 269 251 msn_sb_destroy( sb ); 270 252 return FALSE; … … 287 269 sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb ); 288 270 else 289 debug( "E RROR%d while connecting to switchboard server", 2 );271 debug( "Error %d while connecting to switchboard server", 2 ); 290 272 291 273 return FALSE; … … 298 280 if( msn_handler( sb->handler ) == -1 ) 299 281 { 300 debug( "E RROR: Switchboard died" );282 debug( "Error: Switchboard died" ); 301 283 msn_sb_destroy( sb ); 302 284 … … 555 537 if( sb->who ) 556 538 { 557 struct msn_message *m;558 GSList *l;559 560 539 /* Apparently some invitation failed. We might want to use this 561 540 board later, so keep it as a spare. */ … … 564 543 565 544 /* Also clear the msgq, otherwise someone else might get them. */ 566 for( l = sb->msgq; l; l = l->next ) 567 { 568 m = l->data; 569 g_free( m->who ); 570 g_free( m->text ); 571 g_free( m ); 572 } 573 g_slist_free( sb->msgq ); 574 sb->msgq = NULL; 545 msn_msgq_purge( ic, &sb->msgq ); 575 546 } 576 547
Note: See TracChangeset
for help on using the changeset viewer.