Changeset 09adf08 for commands.c


Ignore:
Timestamp:
2005-12-08T15:31:25Z (19 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
7cad7b4
Parents:
8efa2f4
Message:

Couple of small bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r8efa2f4 r09adf08  
    8686int cmd_identify( irc_t *irc, char **cmd )
    8787{
    88         int checkie = global.storage->load( irc->nick, cmd[1], irc );
    89        
    90         if( checkie == -1 )
    91         {
     88        storage_status_t status = global.storage->load( irc->nick, cmd[1], irc );
     89       
     90        switch (status) {
     91        case STORAGE_INVALID_PASSWORD:
    9292                irc_usermsg( irc, "Incorrect password" );
    93         }
    94         else if( checkie == 0 )
    95         {
     93                break;
     94        case STORAGE_NO_SUCH_USER:
    9695                irc_usermsg( irc, "The nick is (probably) not registered" );
    97         }
    98         else if( checkie == 1 )
    99         {
     96                break;
     97        case STORAGE_OK:
    10098                irc_usermsg( irc, "Password accepted" );
    101         }
    102         else
    103         {
     99                break;
     100        default:
    104101                irc_usermsg( irc, "Something very weird happened" );
     102                break;
    105103        }
    106104       
     
    618616int cmd_save( irc_t *irc, char **cmd )
    619617{
    620         if( global.storage->save( irc, TRUE ) )
     618        if( global.storage->save( irc, TRUE ) == STORAGE_OK )
    621619                irc_usermsg( irc, "Configuration saved" );
    622620        else
Note: See TracChangeset for help on using the changeset viewer.