Changeset 7f421d6


Ignore:
Timestamp:
2008-03-03T23:18:36Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
9ad86bb
Parents:
ed3ae7e
Message:

BitlBee <= 1.0 didn't have "account set" and allowed one to delete an account
and re-create it with new login settings if necessary, without losing custom
nicknames. Now, nicknames are connected to an account instead of just the
protocol, and they're flushed together with the account. So I added a warning
to make sure nobody accidentally loses any settings while just changing the
password. This will probably go after a few releases, since it's slightly
annoying.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • query.c

    red3ae7e r7f421d6  
    140140        if( ans )
    141141        {
    142                 imcb_log( q->ic, "Accepted: %s", q->question );
     142                if( q->ic )
     143                        imcb_log( q->ic, "Accepted: %s", q->question );
     144                else
     145                        irc_usermsg( irc, "Accepted: %s", q->question );
    143146                q->yes( NULL, q->data );
    144147        }
    145148        else
    146149        {
    147                 imcb_log( q->ic, "Rejected: %s", q->question );
     150                if( q->ic )
     151                        imcb_log( q->ic, "Rejected: %s", q->question );
     152                else
     153                        irc_usermsg( irc, "Rejected: %s", q->question );
    148154                q->no( NULL, q->data );
    149155        }
  • root_commands.c

    red3ae7e r7f421d6  
    204204}
    205205
     206void cmd_account_del_yes( gpointer w, void *data )
     207{
     208        account_t *a = data;
     209        irc_t *irc = a->irc;
     210       
     211        if( a->ic )
     212        {
     213                irc_usermsg( irc, "Account is still logged in, can't delete" );
     214        }
     215        else
     216        {
     217                account_del( irc, a );
     218                irc_usermsg( irc, "Account deleted" );
     219        }
     220}
     221
     222void cmd_account_del_no( gpointer w, void *data )
     223{
     224}
     225
    206226static void cmd_account( irc_t *irc, char **cmd )
    207227{
     
    258278                else
    259279                {
    260                         account_del( irc, a );
    261                         irc_usermsg( irc, "Account deleted" );
     280                        char *msg;
     281                       
     282                        msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
     283                                               "also forget all your saved nicknames. If you want "
     284                                               "to change your username/password, use the `account "
     285                                               "set' command. Are you sure you want to delete this "
     286                                               "account?", a->prpl->name, a->user );
     287                        query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a );
     288                        g_free( msg );
    262289                }
    263290        }
Note: See TracChangeset for help on using the changeset viewer.