Changeset e8c8d00 for protocols/msn/ns.c
- Timestamp:
- 2010-03-17T15:15:19Z (15 years ago)
- Branches:
- master
- Children:
- 60e4df3
- Parents:
- 1c3008a (diff), f9928cb (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/ns.c
r1c3008a re8c8d00 229 229 } 230 230 } 231 else if( num_parts == 7 && strcmp( cmd[2], "OK" ) == 0 )231 else if( num_parts >= 7 && strcmp( cmd[2], "OK" ) == 0 ) 232 232 { 233 233 set_t *s; 234 234 235 http_decode( cmd[4] ); 236 237 strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) ); 238 ic->displayname[sizeof(ic->displayname)-1] = 0; 239 240 if( ( s = set_find( &ic->acc->set, "display_name" ) ) ) 241 { 242 g_free( s->value ); 243 s->value = g_strdup( cmd[4] ); 235 if( num_parts == 7 ) 236 { 237 http_decode( cmd[4] ); 238 239 strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) ); 240 ic->displayname[sizeof(ic->displayname)-1] = 0; 241 242 if( ( s = set_find( &ic->acc->set, "display_name" ) ) ) 243 { 244 g_free( s->value ); 245 s->value = g_strdup( cmd[4] ); 246 } 247 } 248 else 249 { 250 imcb_log( ic, "Warning: Friendly name in server response was corrupted" ); 244 251 } 245 252 … … 420 427 { 421 428 /* FIXME: Warn/Bomb about unknown away state? */ 422 st = msn_away_state_list; 423 } 424 425 imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN | 426 ( st->number ? OPT_AWAY : 0 ), st->name, NULL ); 429 st = msn_away_state_list + 1; 430 } 431 432 imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN | 433 ( st != msn_away_state_list ? OPT_AWAY : 0 ), 434 st->name, NULL ); 427 435 } 428 436 else if( strcmp( cmd[0], "FLN" ) == 0 ) … … 449 457 { 450 458 /* FIXME: Warn/Bomb about unknown away state? */ 451 st = msn_away_state_list; 452 } 453 454 imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN | 455 ( st->number ? OPT_AWAY : 0 ), st->name, NULL ); 459 st = msn_away_state_list + 1; 460 } 461 462 imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN | 463 ( st != msn_away_state_list ? OPT_AWAY : 0 ), 464 st->name, NULL ); 456 465 } 457 466 else if( strcmp( cmd[0], "RNG" ) == 0 ) … … 663 672 } 664 673 665 if( arg1 )g_free( arg1 );666 if( mtype )g_free( mtype );674 g_free( arg1 ); 675 g_free( mtype ); 667 676 } 668 677 else if( g_strncasecmp( ct, "text/x-msmsgsprofile", 20 ) == 0 ) … … 672 681 else if( g_strncasecmp( ct, "text/x-msmsgsinitialemailnotification", 37 ) == 0 ) 673 682 { 674 char *inbox = msn_findheader( body, "Inbox-Unread:", blen ); 675 char *folders = msn_findheader( body, "Folders-Unread:", blen ); 676 677 if( inbox && folders && set_getbool( &ic->acc->set, "mail_notifications" ) ) 683 if( set_getbool( &ic->acc->set, "mail_notifications" ) ) 678 684 { 679 imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders ); 685 char *inbox = msn_findheader( body, "Inbox-Unread:", blen ); 686 char *folders = msn_findheader( body, "Folders-Unread:", blen ); 687 688 if( inbox && folders ) 689 imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders ); 690 691 g_free( inbox ); 692 g_free( folders ); 680 693 } 681 682 g_free( inbox );683 g_free( folders );684 694 } 685 695 else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 ) 686 696 { 687 char *from = msn_findheader( body, "From-Addr:", blen ); 688 char *fromname = msn_findheader( body, "From:", blen ); 689 690 if( from && fromname && set_getbool( &ic->acc->set, "mail_notifications" ) ) 697 if( set_getbool( &ic->acc->set, "mail_notifications" ) ) 691 698 { 692 imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from ); 699 char *from = msn_findheader( body, "From-Addr:", blen ); 700 char *fromname = msn_findheader( body, "From:", blen ); 701 702 if( from && fromname ) 703 imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from ); 704 705 g_free( from ); 706 g_free( fromname ); 693 707 } 694 708 }
Note: See TracChangeset
for help on using the changeset viewer.