Changes in protocols/msn/sb.c [fe79de66:dcf155d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
rfe79de66 rdcf155d 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-201 2Wilmer van der Gaast and others *4 * Copyright 2002-2010 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 122 122 } 123 123 124 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, c onst char *handle )124 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle ) 125 125 { 126 126 struct msn_data *md = ic->proto_data; … … 308 308 struct msn_switchboard *sb = data; 309 309 struct im_connection *ic; 310 struct msn_data *md;311 310 char buf[1024]; 312 311 … … 316 315 317 316 ic = sb->ic; 318 md = ic->proto_data;319 317 320 318 if( source != sb->fd ) … … 334 332 335 333 if( sb->session == MSN_SB_NEW ) 336 g_snprintf( buf, sizeof( buf ), "USR %d %s ;{%s} %s\r\n", ++sb->trId, ic->acc->user, md->uuid, sb->key );334 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->acc->user, sb->key ); 337 335 else 338 g_snprintf( buf, sizeof( buf ), "ANS %d %s ;{%s} %s %d\r\n", ++sb->trId, ic->acc->user, md->uuid, sb->key, sb->session );336 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->acc->user, sb->key, sb->session ); 339 337 340 338 if( msn_sb_write( sb, "%s", buf ) ) … … 455 453 char buf[1024]; 456 454 457 /* For as much as I understand this MPOP stuff now, a 458 switchboard has two (or more) roster entries per 459 participant. One "bare JID" and one JID;UUID. Ignore 460 the latter. */ 461 if( !strchr( cmd[4], ';' ) ) 455 if( num == 1 ) 462 456 { 463 /* HACK: Since even 1:1 chats now have >2 participants 464 (ourselves included) it gets hard to tell them apart 465 from rooms. Let's hope this is enough: */ 466 if( sb->chat == NULL && num != tot ) 467 { 468 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 469 sb->chat = imcb_chat_new( ic, buf ); 470 471 g_free( sb->who ); 472 sb->who = NULL; 473 } 457 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 458 sb->chat = imcb_chat_new( ic, buf ); 474 459 475 if( sb->chat )476 imcb_chat_add_buddy( sb->chat, cmd[4] );477 } 478 479 /* We have the full roster, start showing the channel to480 the user. */481 if( num == tot && sb->chat)460 g_free( sb->who ); 461 sb->who = NULL; 462 } 463 464 imcb_chat_add_buddy( sb->chat, cmd[4] ); 465 466 if( num == tot ) 482 467 { 483 468 imcb_chat_add_buddy( sb->chat, ic->acc->user ); … … 521 506 return( 0 ); 522 507 } 523 524 /* See IRO above. Handle "bare JIDs" only. */525 if( strchr( cmd[1], ';' ) )526 return 1;527 508 528 509 if( sb->who && g_strcasecmp( cmd[1], sb->who ) == 0 ) … … 560 541 return( st ); 561 542 } 562 else if( strcmp( cmd[1], ic->acc->user ) == 0 )563 {564 /* Well, gee thanks. Thanks for letting me know I've arrived.. */565 }566 543 else if( sb->who ) 567 544 { … … 636 613 The server will clean it up when it's idle for too long. */ 637 614 } 638 else if( sb->chat && !strchr( cmd[1], ';' ))615 else if( sb->chat ) 639 616 { 640 617 imcb_chat_remove_buddy( sb->chat, cmd[1], "" ); … … 652 629 /* If the person is offline, send an offline message instead, 653 630 and don't report an error. */ 631 /* TODO: Support for OIMs that works. (#874) */ 632 /* 654 633 if( num == 217 ) 655 msn_ ns_oim_send_queue( ic, &sb->msgq );634 msn_soap_oim_send_queue( ic, &sb->msgq ); 656 635 else 636 */ 657 637 imcb_error( ic, "Error reported by switchboard server: %s", err->text ); 658 638
Note: See TracChangeset
for help on using the changeset viewer.