Changeset 52a2521
- Timestamp:
- 2010-06-30T23:46:55Z (14 years ago)
- Branches:
- master
- Children:
- 3353b5e
- Parents:
- 06f9548
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
r06f9548 r52a2521 421 421 422 422 /* Try to find a channel that expects to receive a groupchat. 423 This flag is set by groupchat_stub_invite(). */423 This flag is set earlier in our current call trace. */ 424 424 for( l = irc->channels; l; l = l->next ) 425 425 { … … 530 530 { 531 531 irc_t *irc = bee->ui_data; 532 irc_channel_t *ic = c->ui_data ;532 irc_channel_t *ic = c->ui_data, *oic; 533 533 char stripped[MAX_NICK_LENGTH+1], *full_name; 534 534 … … 543 543 nick_lc( stripped ); 544 544 545 if( stripped[0] == '\0' ) 546 return FALSE; 547 545 548 full_name = g_strdup_printf( "#%s", stripped ); 546 547 if( stripped[0] && irc_channel_by_name( irc, full_name ) == NULL ) 548 { 549 g_free( ic->name ); 550 ic->name = full_name; 551 } 552 else 553 { 554 g_free( full_name ); 555 } 549 if( ( oic = irc_channel_by_name( irc, full_name ) ) ) 550 { 551 char *type, *chat_type; 552 553 type = set_getstr( &oic->set, "type" ); 554 chat_type = set_getstr( &oic->set, "chat_type" ); 555 556 if( type && chat_type && oic->data == FALSE && 557 strcmp( type, "chat" ) == 0 && 558 strcmp( chat_type, "groupchat" ) == 0 ) 559 { 560 /* There's a channel with this name already, but it looks 561 like it's not in use yet. Most likely the IRC client 562 rejoined the channel after a reconnect. Remove it so 563 we can reuse its name. */ 564 irc_channel_free( oic ); 565 } 566 else 567 { 568 g_free( full_name ); 569 return FALSE; 570 } 571 } 572 573 g_free( ic->name ); 574 ic->name = full_name; 556 575 557 576 return TRUE;
Note: See TracChangeset
for help on using the changeset viewer.