Changeset b79308b for root_commands.c


Ignore:
Timestamp:
2008-04-14T13:10:53Z (11 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
0cab388
Parents:
6cac643 (diff), aa31117 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged in upstream r379 (somewhere after 1.2-3).
Just one trivial conflict in the jabber Makefile, went smoothly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r6cac643 rb79308b  
    204204}
    205205
     206struct cmd_account_del_data
     207{
     208        account_t *a;
     209        irc_t *irc;
     210};
     211
     212void cmd_account_del_yes( void *data )
     213{
     214        struct cmd_account_del_data *cad = data;
     215        account_t *a;
     216       
     217        for( a = cad->irc->accounts; a && a != cad->a; a = a->next );
     218       
     219        if( a == NULL )
     220        {
     221                irc_usermsg( cad->irc, "Account already deleted" );
     222        }
     223        else if( a->ic )
     224        {
     225                irc_usermsg( cad->irc, "Account is still logged in, can't delete" );
     226        }
     227        else
     228        {
     229                account_del( cad->irc, a );
     230                irc_usermsg( cad->irc, "Account deleted" );
     231        }
     232        g_free( data );
     233}
     234
     235void cmd_account_del_no( void *data )
     236{
     237        g_free( data );
     238}
     239
    206240static void cmd_account( irc_t *irc, char **cmd )
    207241{
     
    258292                else
    259293                {
    260                         account_del( irc, a );
    261                         irc_usermsg( irc, "Account deleted" );
     294                        struct cmd_account_del_data *cad;
     295                        char *msg;
     296                       
     297                        cad = g_malloc( sizeof( struct cmd_account_del_data ) );
     298                        cad->a = a;
     299                        cad->irc = irc;
     300                       
     301                        msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
     302                                               "also forget all your saved nicknames. If you want "
     303                                               "to change your username/password, use the `account "
     304                                               "set' command. Are you sure you want to delete this "
     305                                               "account?", a->prpl->name, a->user );
     306                        query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad );
     307                        g_free( msg );
    262308                }
    263309        }
     
    557603                        g_free( irc->mynick );
    558604                        irc->mynick = g_strdup( cmd[2] );
     605                       
     606                        if( strcmp( cmd[0], "set_rename" ) != 0 )
     607                                set_setstr( &irc->set, "root_nick", cmd[2] );
    559608                }
    560609                else if( u->send_handler == buddy_send_handler )
     
    565614                irc_usermsg( irc, "Nick successfully changed" );
    566615        }
     616}
     617
     618char *set_eval_root_nick( set_t *set, char *new_nick )
     619{
     620        irc_t *irc = set->data;
     621       
     622        if( strcmp( irc->mynick, new_nick ) != 0 )
     623        {
     624                char *cmd[] = { "set_rename", irc->mynick, new_nick, NULL };
     625               
     626                cmd_rename( irc, cmd );
     627        }
     628       
     629        return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : NULL;
    567630}
    568631
     
    769832                else
    770833                        irc_usermsg( irc, "%s is empty", set_name );
     834
     835                if( strchr( set_name, '/' ) )
     836                        irc_usermsg( irc, "Warning: / found in setting name, you're probably looking for the `account set' command." );
    771837        }
    772838        else
Note: See TracChangeset for help on using the changeset viewer.