Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    rfda55fa rac2717b  
    252252{
    253253        irc_user_t *iu = (irc_user_t *) bu->ui_data;
     254        irc_t *irc = (irc_t *) bee->ui_data;
    254255        char *s;
    255256       
     
    265266        if( ( bu->ic->flags & OPT_LOGGED_IN ) && set_getbool( &bee->set, "display_namechanges" ) )
    266267        {
    267                 /* People don't like this /NOTICE. Meh, let's go back to the old one.
    268268                char *msg = g_strdup_printf( "<< \002BitlBee\002 - Changed name to `%s' >>", iu->fullname );
    269269                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 );
    272270        }
    273271       
     
    615613}
    616614
    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 
    674615/* IRC->IM */
    675616static gboolean bee_irc_channel_chat_privmsg_cb( gpointer data, gint fd, b_input_condition cond );
     
    968909        bee_irc_chat_topic,
    969910        bee_irc_chat_name_hint,
    970         bee_irc_chat_invite,
    971911       
    972912        bee_irc_ft_in_start,
Note: See TracChangeset for help on using the changeset viewer.