Changeset 6fd4d46


Ignore:
Timestamp:
2010-05-13T00:22:28Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
58f5ef7
Parents:
3663bb3
Message:

Restore "account del".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r3663bb3 r6fd4d46  
    196196}
    197197
    198 struct cmd_account_del_data
    199 {
    200         account_t *a;
    201         irc_t *irc;
    202 };
    203 
    204 void cmd_account_del_yes( void *data )
    205 {
    206         struct cmd_account_del_data *cad = data;
    207         account_t *a;
    208        
    209         for( a = cad->irc->b->accounts; a && a != cad->a; a = a->next );
    210        
    211         if( a == NULL )
    212         {
    213                 irc_usermsg( cad->irc, "Account already deleted" );
    214         }
    215         else if( a->ic )
    216         {
    217                 irc_usermsg( cad->irc, "Account is still logged in, can't delete" );
    218         }
    219         else
    220         {
    221                 account_del( cad->irc->b, a );
    222                 irc_usermsg( cad->irc, "Account deleted" );
    223         }
    224         g_free( data );
    225 }
    226 
    227 void cmd_account_del_no( void *data )
    228 {
    229         g_free( data );
    230 }
    231 
    232198static void cmd_showset( irc_t *irc, set_t **head, char *key )
    233199{
     
    403369                else
    404370                {
    405                         struct cmd_account_del_data *cad;
    406                         char *msg;
    407                        
    408                         cad = g_malloc( sizeof( struct cmd_account_del_data ) );
    409                         cad->a = a;
    410                         cad->irc = irc;
    411                        
    412                         msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
    413                                                "also forget all your saved nicknames. If you want "
    414                                                "to change your username/password, use the `account "
    415                                                "set' command. Are you sure you want to delete this "
    416                                                "account?", a->prpl->name, a->user );
    417                         //query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad );
    418                         g_free( msg );
     371                        account_del( irc->b, a );
     372                        irc_usermsg( irc, "Account deleted" );
    419373                }
    420374        }
Note: See TracChangeset for help on using the changeset viewer.