Changes in irc_im.c [ac2717b:fda55fa]
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
rac2717b rfda55fa 252 252 { 253 253 irc_user_t *iu = (irc_user_t *) bu->ui_data; 254 irc_t *irc = (irc_t *) bee->ui_data;255 254 char *s; 256 255 … … 266 265 if( ( bu->ic->flags & OPT_LOGGED_IN ) && set_getbool( &bee->set, "display_namechanges" ) ) 267 266 { 267 /* People don't like this /NOTICE. Meh, let's go back to the old one. 268 268 char *msg = g_strdup_printf( "<< \002BitlBee\002 - Changed name to `%s' >>", iu->fullname ); 269 269 irc_send_msg( iu, "NOTICE", irc->user->nick, msg, NULL ); 270 */ 271 imcb_log( bu->ic, "User `%s' changed name to `%s'", iu->nick, iu->fullname ); 270 272 } 271 273 … … 613 615 } 614 616 617 static gboolean bee_irc_chat_invite( bee_t *bee, bee_user_t *bu, const char *name, const char *msg ) 618 { 619 char *channel, *s; 620 irc_t *irc = bee->ui_data; 621 irc_user_t *iu = bu->ui_data; 622 irc_channel_t *chan; 623 624 if( strchr( CTYPES, name[0] ) ) 625 channel = g_strdup( name ); 626 else 627 channel = g_strdup_printf( "#%s", name ); 628 629 if( ( s = strchr( channel, '@' ) ) ) 630 *s = '\0'; 631 632 if( strlen( channel ) > MAX_NICK_LENGTH ) 633 { 634 /* If the channel name is very long (like those insane GTalk 635 UUID names), try if we can use the inviter's nick. */ 636 s = g_strdup_printf( "#%s", iu->nick ); 637 if( irc_channel_by_name( irc, s ) == NULL ) 638 { 639 g_free( channel ); 640 channel = s; 641 } 642 } 643 644 if( ( chan = irc_channel_new( irc, channel ) ) && 645 set_setstr( &chan->set, "type", "chat" ) && 646 set_setstr( &chan->set, "chat_type", "room" ) && 647 set_setstr( &chan->set, "account", bu->ic->acc->tag ) && 648 set_setstr( &chan->set, "room", (char*) name ) ) 649 { 650 /* I'm assuming that if the user didn't "chat add" the room 651 himself but got invited, it's temporary, so make this a 652 temporary mapping that is removed as soon as we /PART. */ 653 chan->flags |= IRC_CHANNEL_TEMP; 654 } 655 else 656 { 657 irc_channel_free( chan ); 658 chan = NULL; 659 } 660 g_free( channel ); 661 662 irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "<< \002BitlBee\002 - Invitation to chatroom %s >>", name ); 663 if( msg ) 664 irc_send_msg( iu, "PRIVMSG", irc->user->nick, msg, NULL ); 665 if( chan ) 666 { 667 irc_send_msg_f( iu, "PRIVMSG", irc->user->nick, "To join the room, just /join %s", chan->name ); 668 irc_send_invite( iu, chan ); 669 } 670 671 return TRUE; 672 } 673 615 674 /* IRC->IM */ 616 675 static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond ); … … 909 968 bee_irc_chat_topic, 910 969 bee_irc_chat_name_hint, 970 bee_irc_chat_invite, 911 971 912 972 bee_irc_ft_in_start,
Note: See TracChangeset
for help on using the changeset viewer.