Changeset aef4828 for protocols/msn
- Timestamp:
- 2007-04-06T05:20:31Z (18 years ago)
- Branches:
- master
- Children:
- 552e641
- Parents:
- 0da65d5
- Location:
- protocols/msn
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r0da65d5 raef4828 39 39 static void msn_login( account_t *acc ) 40 40 { 41 struct im_connection *ic = new_gaim_conn( acc );41 struct im_connection *ic = imc_new( acc ); 42 42 struct msn_data *md = g_new0( struct msn_data, 1 ); 43 43 … … 47 47 if( strchr( acc->user, '@' ) == NULL ) 48 48 { 49 hide_login_progress( ic, "Invalid account name" );50 signoff( ic );49 imc_error( ic, "Invalid account name" ); 50 imc_logout( ic ); 51 51 return; 52 52 } 53 53 54 set_login_progress( ic, 1, "Connecting" );54 imc_log( ic, "Connecting" ); 55 55 56 56 md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic ); 57 57 if( md->fd < 0 ) 58 58 { 59 hide_login_progress( ic, "Could not connect to server" );60 signoff( ic );59 imc_error( ic, "Could not connect to server" ); 60 imc_logout( ic ); 61 61 return; 62 62 } … … 96 96 m = l->data; 97 97 98 serv_got_crap( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );98 imc_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 99 99 g_free( m->who ); 100 100 g_free( m->text ); … … 228 228 { 229 229 /* Just make an URL and let the user fetch the info */ 230 serv_got_crap( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );230 imc_log( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who ); 231 231 } 232 232 … … 373 373 if( strlen( value ) > 129 ) 374 374 { 375 serv_got_crap( ic, "Maximum name length exceeded" );375 imc_log( ic, "Maximum name length exceeded" ); 376 376 return NULL; 377 377 } -
protocols/msn/msn_util.c
r0da65d5 raef4828 36 36 if( st != len ) 37 37 { 38 hide_login_progress_error( ic, "Short write() to main server" );39 signoff( ic );38 imc_error( ic, "Short write() to main server" ); 39 imc_logout( ic ); 40 40 return( 0 ); 41 41 } … … 46 46 int msn_logged_in( struct im_connection *ic ) 47 47 { 48 account_online( ic );48 imc_connected( ic ); 49 49 50 50 return( 0 ); -
protocols/msn/ns.c
r0da65d5 raef4828 47 47 if( source == -1 ) 48 48 { 49 hide_login_progress( ic, "Could not connect to server" );50 signoff( ic );49 imc_error( ic, "Could not connect to server" ); 50 imc_logout( ic ); 51 51 return FALSE; 52 52 } … … 76 76 { 77 77 ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic ); 78 set_login_progress( ic, 1, "Connected to server, waiting for reply" );78 imc_log( ic, "Connected to server, waiting for reply" ); 79 79 } 80 80 … … 89 89 if( msn_handler( md->handler ) == -1 ) /* Don't do this on ret == 0, it's already done then. */ 90 90 { 91 hide_login_progress( ic, "Error while reading from server" );92 signoff( ic );91 imc_error( ic, "Error while reading from server" ); 92 imc_logout( ic ); 93 93 94 94 return FALSE; … … 114 114 if( cmd[2] && strncmp( cmd[2], "MSNP8", 5 ) != 0 ) 115 115 { 116 hide_login_progress( ic, "Unsupported protocol" );117 signoff( ic );116 imc_error( ic, "Unsupported protocol" ); 117 imc_logout( ic ); 118 118 return( 0 ); 119 119 } … … 143 143 if( !server ) 144 144 { 145 hide_login_progress_error( ic, "Syntax error" );146 signoff( ic );145 imc_error( ic, "Syntax error" ); 146 imc_logout( ic ); 147 147 return( 0 ); 148 148 } … … 151 151 server = cmd[3]; 152 152 153 set_login_progress( ic, 1, "Transferring to other server" );153 imc_log( ic, "Transferring to other server" ); 154 154 155 155 md->fd = proxy_connect( server, port, msn_ns_connected, ic ); … … 162 162 if( !server ) 163 163 { 164 hide_login_progress_error( ic, "Syntax error" );165 signoff( ic );164 imc_error( ic, "Syntax error" ); 165 imc_logout( ic ); 166 166 return( 0 ); 167 167 } … … 172 172 if( strcmp( cmd[4], "CKI" ) != 0 ) 173 173 { 174 hide_login_progress_error( ic, "Unknown authentication method for switchboard" );175 signoff( ic );174 imc_error( ic, "Unknown authentication method for switchboard" ); 175 imc_logout( ic ); 176 176 return( 0 ); 177 177 } … … 204 204 else 205 205 { 206 hide_login_progress_error( ic, "Syntax error" );207 signoff( ic );206 imc_error( ic, "Syntax error" ); 207 imc_logout( ic ); 208 208 return( 0 ); 209 209 } … … 216 216 if( !passport_get_id( msn_auth_got_passport_id, ic, ic->username, ic->password, cmd[4] ) ) 217 217 { 218 hide_login_progress_error( ic, "Error while contacting Passport server" );219 signoff( ic );218 imc_error( ic, "Error while contacting Passport server" ); 219 imc_logout( ic ); 220 220 return( 0 ); 221 221 } … … 236 236 } 237 237 238 set_login_progress( ic, 1, "Authenticated, getting buddy list" );238 imc_log( ic, "Authenticated, getting buddy list" ); 239 239 240 240 g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId ); … … 243 243 else 244 244 { 245 hide_login_progress( ic, "Unknown authentication type" );246 signoff( ic );245 imc_error( ic, "Unknown authentication type" ); 246 imc_logout( ic ); 247 247 return( 0 ); 248 248 } … … 252 252 if( num_parts != 4 ) 253 253 { 254 hide_login_progress_error( ic, "Syntax error" );255 signoff( ic );254 imc_error( ic, "Syntax error" ); 255 imc_logout( ic ); 256 256 return( 0 ); 257 257 } … … 261 261 if( md->handler->msglen <= 0 ) 262 262 { 263 hide_login_progress_error( ic, "Syntax error" );264 signoff( ic );263 imc_error( ic, "Syntax error" ); 264 imc_logout( ic ); 265 265 return( 0 ); 266 266 } … … 292 292 if( num_parts != 4 && num_parts != 5 ) 293 293 { 294 hide_login_progress( ic, "Syntax error" );295 signoff( ic );294 imc_error( ic, "Syntax error" ); 295 imc_logout( ic ); 296 296 return( 0 ); 297 297 } … … 328 328 if( ic->flags & OPT_LOGGED_IN ) 329 329 { 330 serv_got_crap( ic, "Successfully transferred to different server" );330 imc_log( ic, "Successfully transferred to different server" ); 331 331 g_snprintf( buf, sizeof( buf ), "CHG %d %s %d\r\n", ++md->trId, md->away_state->code, 0 ); 332 332 return( msn_write( ic, buf, strlen( buf ) ) ); … … 344 344 if( num_parts != 4 ) 345 345 { 346 hide_login_progress_error( ic, "Syntax error" );347 signoff( ic );346 imc_error( ic, "Syntax error" ); 347 imc_logout( ic ); 348 348 return( 0 ); 349 349 } … … 363 363 if( num_parts != 3 ) 364 364 { 365 hide_login_progress_error( ic, "Syntax error" );366 signoff( ic );365 imc_error( ic, "Syntax error" ); 366 imc_logout( ic ); 367 367 return( 0 ); 368 368 } … … 385 385 if( num_parts != 6 ) 386 386 { 387 hide_login_progress_error( ic, "Syntax error" );388 signoff( ic );387 imc_error( ic, "Syntax error" ); 388 imc_logout( ic ); 389 389 return( 0 ); 390 390 } … … 413 413 if( num_parts != 5 ) 414 414 { 415 hide_login_progress_error( ic, "Syntax error" );416 signoff( ic );415 imc_error( ic, "Syntax error" ); 416 imc_logout( ic ); 417 417 return( 0 ); 418 418 } … … 438 438 if( num_parts != 7 ) 439 439 { 440 hide_login_progress_error( ic, "Syntax error" );441 signoff( ic );440 imc_error( ic, "Syntax error" ); 441 imc_logout( ic ); 442 442 return( 0 ); 443 443 } … … 448 448 if( !server ) 449 449 { 450 hide_login_progress_error( ic, "Syntax error" );451 signoff( ic );450 imc_error( ic, "Syntax error" ); 451 imc_logout( ic ); 452 452 return( 0 ); 453 453 } … … 458 458 if( strcmp( cmd[3], "CKI" ) != 0 ) 459 459 { 460 hide_login_progress_error( ic, "Unknown authentication method for switchboard" );461 signoff( ic );460 imc_error( ic, "Unknown authentication method for switchboard" ); 461 imc_logout( ic ); 462 462 return( 0 ); 463 463 } … … 478 478 if( strchr( cmd[4], '@' ) == NULL ) 479 479 { 480 hide_login_progress_error( ic, "Syntax error" );481 signoff( ic );480 imc_error( ic, "Syntax error" ); 481 imc_logout( ic ); 482 482 return( 0 ); 483 483 } … … 499 499 if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 ) 500 500 { 501 hide_login_progress_error( ic, "Someone else logged in with your account" );501 imc_error( ic, "Someone else logged in with your account" ); 502 502 ic->wants_to_die = 1; 503 503 } 504 504 else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 ) 505 505 { 506 hide_login_progress_error( ic, "Terminating session because of server shutdown" );506 imc_error( ic, "Terminating session because of server shutdown" ); 507 507 } 508 508 else 509 509 { 510 hide_login_progress_error( ic, "Session terminated by remote server (reason unknown)" );511 } 512 513 signoff( ic );510 imc_error( ic, "Session terminated by remote server (reason unknown)" ); 511 } 512 513 imc_logout( ic ); 514 514 return( 0 ); 515 515 } … … 518 518 if( num_parts != 5 ) 519 519 { 520 hide_login_progress_error( ic, "Syntax error" );521 signoff( ic );520 imc_error( ic, "Syntax error" ); 521 imc_logout( ic ); 522 522 return( 0 ); 523 523 } … … 546 546 else if( strcmp( cmd[0], "IPG" ) == 0 ) 547 547 { 548 do_error_dialog( ic, "Received IPG command, we don't handle them yet.", "MSN" );548 imc_error( ic, "Received IPG command, we don't handle them yet." ); 549 549 550 550 md->handler->msglen = atoi( cmd[1] ); … … 552 552 if( md->handler->msglen <= 0 ) 553 553 { 554 hide_login_progress_error( ic, "Syntax error" );555 signoff( ic );554 imc_error( ic, "Syntax error" ); 555 imc_logout( ic ); 556 556 return( 0 ); 557 557 } … … 562 562 const struct msn_status_code *err = msn_status_by_number( num ); 563 563 564 g_snprintf( buf, sizeof( buf ), "Error reported by MSN server: %s", err->text ); 565 do_error_dialog( ic, buf, "MSN" ); 564 imc_error( ic, "Error reported by MSN server: %s", err->text ); 566 565 567 566 if( err->flags & STATUS_FATAL ) 568 567 { 569 signoff( ic );568 imc_logout( ic ); 570 569 return( 0 ); 571 570 } … … 617 616 { 618 617 if( arg1 ) 619 serv_got_crap( ic, "The server is going down for maintenance in %s minutes.", arg1 );618 imc_log( ic, "The server is going down for maintenance in %s minutes.", arg1 ); 620 619 } 621 620 … … 634 633 if( inbox && folders ) 635 634 { 636 serv_got_crap( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );635 imc_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders ); 637 636 } 638 637 } … … 644 643 if( from && fromname ) 645 644 { 646 serv_got_crap( ic, "Received an e-mail message from %s <%s>.", fromname, from );645 imc_log( ic, "Received an e-mail message from %s <%s>.", fromname, from ); 647 646 } 648 647 } … … 677 676 rep->error_string ? rep->error_string : "Unknown error" ); 678 677 679 hide_login_progress( ic, err );680 signoff( ic );678 imc_error( ic, err ); 679 imc_logout( ic ); 681 680 682 681 g_free( err ); -
protocols/msn/sb.c
r0da65d5 raef4828 222 222 g_slist_free( sb->msgq ); 223 223 224 serv_got_crap( ic, "Warning: Closing down MSN switchboard connection with "224 imc_log( ic, "Warning: Closing down MSN switchboard connection with " 225 225 "unsent message to %s, you'll have to resend it.", 226 226 sb->who ? sb->who : "(unknown)" ); … … 321 321 if( strcmp( cmd[0], "XFR" ) == 0 ) 322 322 { 323 hide_login_progress_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );324 signoff( ic );323 imc_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" ); 324 imc_logout( ic ); 325 325 return( 0 ); 326 326 } … … 528 528 const struct msn_status_code *err = msn_status_by_number( num ); 529 529 530 g_snprintf( buf, sizeof( buf ), "Error reported by switchboard server: %s", err->text ); 531 do_error_dialog( ic, buf, "MSN" ); 530 imc_error( ic, "Error reported by switchboard server: %s", err->text ); 532 531 533 532 if( err->flags & STATUS_SB_FATAL ) … … 538 537 else if( err->flags & STATUS_FATAL ) 539 538 { 540 signoff( ic );539 imc_logout( ic ); 541 540 return 0; 542 541 }
Note: See TracChangeset
for help on using the changeset viewer.