Changes in protocols/msn/sb.c [dcf155d:fe79de66]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
rdcf155d rfe79de66 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-201 0Wilmer van der Gaast and others *4 * Copyright 2002-2012 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 har *handle )124 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, const 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; 310 311 char buf[1024]; 311 312 … … 315 316 316 317 ic = sb->ic; 318 md = ic->proto_data; 317 319 318 320 if( source != sb->fd ) … … 332 334 333 335 if( sb->session == MSN_SB_NEW ) 334 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->acc->user, sb->key );336 g_snprintf( buf, sizeof( buf ), "USR %d %s;{%s} %s\r\n", ++sb->trId, ic->acc->user, md->uuid, sb->key ); 335 337 else 336 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->acc->user, sb->key, sb->session );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 ); 337 339 338 340 if( msn_sb_write( sb, "%s", buf ) ) … … 453 455 char buf[1024]; 454 456 455 if( num == 1 ) 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], ';' ) ) 456 462 { 457 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 458 sb->chat = imcb_chat_new( ic, buf ); 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 } 459 474 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 )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 to 480 the user. */ 481 if( num == tot && sb->chat ) 467 482 { 468 483 imcb_chat_add_buddy( sb->chat, ic->acc->user ); … … 506 521 return( 0 ); 507 522 } 523 524 /* See IRO above. Handle "bare JIDs" only. */ 525 if( strchr( cmd[1], ';' ) ) 526 return 1; 508 527 509 528 if( sb->who && g_strcasecmp( cmd[1], sb->who ) == 0 ) … … 541 560 return( st ); 542 561 } 562 else if( strcmp( cmd[1], ic->acc->user ) == 0 ) 563 { 564 /* Well, gee thanks. Thanks for letting me know I've arrived.. */ 565 } 543 566 else if( sb->who ) 544 567 { … … 613 636 The server will clean it up when it's idle for too long. */ 614 637 } 615 else if( sb->chat )638 else if( sb->chat && !strchr( cmd[1], ';' ) ) 616 639 { 617 640 imcb_chat_remove_buddy( sb->chat, cmd[1], "" ); … … 629 652 /* If the person is offline, send an offline message instead, 630 653 and don't report an error. */ 631 /* TODO: Support for OIMs that works. (#874) */632 /*633 654 if( num == 217 ) 634 msn_ soap_oim_send_queue( ic, &sb->msgq );655 msn_ns_oim_send_queue( ic, &sb->msgq ); 635 656 else 636 */637 657 imcb_error( ic, "Error reported by switchboard server: %s", err->text ); 638 658
Note: See TracChangeset
for help on using the changeset viewer.