Changes in / [c5bff81:b556e46]


Ignore:
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rc5bff81 rb556e46  
    372372        /* Try to save data for all active connections (if desired). */
    373373        while( irc_connection_list != NULL )
    374                 irc_free( irc_connection_list->data );
     374                irc_abort( irc_connection_list->data, FALSE,
     375                           "BitlBee server shutting down" );
    375376       
    376377        /* We'll only reach this point when not running in inetd mode: */
  • doc/user-guide/commands.xml

    rc5bff81 rb556e46  
    10931093        </bitlbee-setting>
    10941094
     1095        <bitlbee-setting name="translate_to_nicks" type="boolean" scope="channel">
     1096                <default>true</default>
     1097
     1098                <description>
     1099                        <para>
     1100                                IRC's nickname namespace is quite limited compared to most IM protocols. Not any non-ASCII characters are allowed, in fact nicknames have to be mostly alpha-numeric. Also, BitlBee has to add underscores sometimes to avoid nickname collisions.
     1101                        </para>
     1102
     1103                        <para>
     1104                                While normally the BitlBee user is the only one seeing these names, they may be exposed to other chatroom participants for example when addressing someone in the channel (with or without tab completion). By default BitlBee will translate these stripped nicknames back to the original nick. If you don't want this, disable this setting.
     1105                        </para>
     1106                </description>
     1107        </bitlbee-setting>
     1108
    10951109        <bitlbee-setting name="type" type="string" scope="channel">
    10961110                <default>control</default>
  • irc_commands.c

    rc5bff81 rb556e46  
    7272static void irc_cmd_nick( irc_t *irc, char **cmd )
    7373{
    74         if( irc_user_by_name( irc, cmd[1] ) )
    75         {
    76                 irc_send_num( irc, 433, ":This nick is already in use" );
     74        irc_user_t *iu;
     75       
     76        if( ( iu = irc_user_by_name( irc, cmd[1] ) ) && iu != irc->user )
     77        {
     78                irc_send_num( irc, 433, "%s :This nick is already in use", cmd[1] );
    7779        }
    7880        else if( !nick_ok( cmd[1] ) )
    7981        {
    8082                /* [SH] Invalid characters. */
    81                 irc_send_num( irc, 432, ":This nick contains invalid characters" );
    82         }
    83         else if( irc->user->nick )
     83                irc_send_num( irc, 432, "%s :This nick contains invalid characters", cmd[1] );
     84        }
     85        else if( irc->status & USTATUS_LOGGED_IN )
    8486        {
    8587                if( irc->status & USTATUS_IDENTIFIED )
     
    98100        else
    99101        {
     102                g_free( irc->user->nick );
    100103                irc->user->nick = g_strdup( cmd[1] );
    101104               
  • irc_im.c

    rc5bff81 rb556e46  
    603603{
    604604        struct groupchat *c = ic->data;
     605        char *trans = NULL, *s;
    605606       
    606607        if( c == NULL )
    607608                return FALSE;
    608         else if( set_getbool( &ic->irc->b->set, "paste_buffer" ) )
     609       
     610        if( set_getbool( &ic->set, "translate_to_nicks" ) )
     611        {
     612                char nick[MAX_NICK_LENGTH+1];
     613                irc_user_t *iu;
     614               
     615                strncpy( nick, msg, MAX_NICK_LENGTH );
     616                nick[MAX_NICK_LENGTH] = '\0';
     617                if( ( s = strchr( nick, ':' ) ) || ( s = strchr( nick, ',' ) ) )
     618                {
     619                        *s = '\0';
     620                        if( ( iu = irc_user_by_name( ic->irc, nick ) ) &&
     621                            iu->bu->nick && irc_channel_has_user( ic, iu ) )
     622                        {
     623                                trans = g_strconcat( iu->bu->nick, msg + ( s - nick ), NULL );
     624                                msg = trans;
     625                        }
     626                }
     627        }
     628       
     629        if( set_getbool( &ic->irc->b->set, "paste_buffer" ) )
    609630        {
    610631                int delay;
     
    623644                ic->pastebuf_timer = b_timeout_add( delay, bee_irc_channel_chat_privmsg_cb, ic );
    624645               
     646                g_free( trans );
    625647                return TRUE;
    626648        }
     
    628650                bee_chat_msg( ic->irc->b, c, msg, 0 );
    629651       
     652        g_free( trans );
    630653        return TRUE;
    631654}
     
    747770        set_add( &ic->set, "nick", NULL, NULL, ic );
    748771        set_add( &ic->set, "room", NULL, NULL, ic );
     772        set_add( &ic->set, "translate_to_nicks", "true", set_eval_bool, ic );
    749773       
    750774        /* chat_type == groupchat */
     
    790814        set_del( &ic->set, "nick" );
    791815        set_del( &ic->set, "room" );
     816        set_del( &ic->set, "translate_to_nicks" );
    792817       
    793818        ic->flags &= ~IRC_CHANNEL_TEMP;
  • irc_user.c

    rc5bff81 rb556e46  
    121121{
    122122        irc_t *irc = iu->irc;
     123        irc_user_t *new_iu;
    123124        char key[strlen(new)+1];
    124125        GSList *cl;
    125126       
    126127        strcpy( key, new );
    127         if( iu == NULL || !nick_lc( key ) || irc_user_by_name( irc, new ) )
     128        if( iu == NULL || !nick_lc( key ) ||
     129            ( ( new_iu = irc_user_by_name( irc, new ) ) && new_iu != iu ) )
    128130                return 0;
    129131       
  • protocols/bee.h

    rc5bff81 rb556e46  
    6262        char *handle;
    6363        char *fullname;
     64        char *nick;
    6465        struct bee_group *group;
    6566
  • protocols/bee_user.c

    rc5bff81 rb556e46  
    6060        g_free( bu->handle );
    6161        g_free( bu->fullname );
     62        g_free( bu->nick );
    6263        g_free( bu->status );
    6364        g_free( bu->status_msg );
  • protocols/nogaim.c

    rc5bff81 rb556e46  
    427427       
    428428        if( !bu || !nick ) return;
     429       
     430        g_free( bu->nick );
     431        bu->nick = g_strdup( nick );
    429432       
    430433        if( bee->ui->user_nick_hint )
  • root_commands.c

    rc5bff81 rb556e46  
    680680static void cmd_rename( irc_t *irc, char **cmd )
    681681{
    682         irc_user_t *iu;
     682        irc_user_t *iu, *old;
    683683       
    684684        iu = irc_user_by_name( irc, cmd[1] );
     
    696696                irc_usermsg( irc, "Nick `%s' is invalid", cmd[2] );
    697697        }
    698         else if( irc_user_by_name( irc, cmd[2] ) )
     698        else if( ( old = irc_user_by_name( irc, cmd[2] ) ) && old != iu )
    699699        {
    700700                irc_usermsg( irc, "Nick `%s' already exists", cmd[2] );
Note: See TracChangeset for help on using the changeset viewer.