Changeset 1f92a58 for root_commands.c


Ignore:
Timestamp:
2010-04-10T02:27:50Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
17a6ee9
Parents:
57c96f7
Message:

Restore the storage module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r57c96f7 r1f92a58  
    136136}
    137137
    138 #if 0
    139138static void cmd_account( irc_t *irc, char **cmd );
    140139
     
    162161                irc->status |= USTATUS_IDENTIFIED;
    163162                irc_umode_set( irc, "+R", 1 );
    164                 if( set_getbool( &irc->set, "auto_connect" ) )
     163                if( set_getbool( &irc->b->set, "auto_connect" ) )
    165164                        cmd_account( irc, account_on );
    166165                break;
     
    202201        storage_status_t status;
    203202       
    204         status = storage_remove (irc->nick, cmd[1]);
     203        status = storage_remove (irc->user->nick, cmd[1]);
    205204        switch (status) {
    206205        case STORAGE_NO_SUCH_USER:
     
    214213                irc->status &= ~USTATUS_IDENTIFIED;
    215214                irc_umode_set( irc, "-R", 1 );
    216                 irc_usermsg( irc, "Account `%s' removed", irc->nick );
     215                irc_usermsg( irc, "Account `%s' removed", irc->user->nick );
    217216                break;
    218217        default:
     
    221220        }
    222221}
    223 #endif
     222
     223static void cmd_save( irc_t *irc, char **cmd )
     224{
     225        if( ( irc->status & USTATUS_IDENTIFIED ) == 0 )
     226                irc_usermsg( irc, "Please create an account first" );
     227        else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK )
     228                irc_usermsg( irc, "Configuration saved" );
     229        else
     230                irc_usermsg( irc, "Configuration could not be saved!" );
     231}
    224232
    225233struct cmd_account_del_data
     
    909917}
    910918
    911 static void cmd_save( irc_t *irc, char **cmd )
    912 {
    913         if( ( irc->status & USTATUS_IDENTIFIED ) == 0 )
    914                 irc_usermsg( irc, "Please create an account first" );
    915         else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK )
    916                 irc_usermsg( irc, "Configuration saved" );
    917         else
    918                 irc_usermsg( irc, "Configuration could not be saved!" );
    919 }
    920 
    921919static void cmd_blist( irc_t *irc, char **cmd )
    922920{
     
    984982}
    985983
    986 static void cmd_nick( irc_t *irc, char **cmd )
    987 {
    988         account_t *a;
    989 
    990         if( !cmd[1] || !( a = account_get( irc, cmd[1] ) ) )
    991         {
    992                 irc_usermsg( irc, "Invalid account");
    993         }
    994         else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) )
    995         {
    996                 irc_usermsg( irc, "That account is not on-line" );
    997         }
    998         else if ( !cmd[2] )
    999         {
    1000                 irc_usermsg( irc, "Your name is `%s'" , a->ic->displayname ? a->ic->displayname : "NULL" );
    1001         }
    1002         else if ( !a->prpl->set_my_name )
    1003         {
    1004                 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
    1005         }
    1006         else
    1007         {
    1008                 irc_usermsg( irc, "Setting your name to `%s'", cmd[2] );
    1009                
    1010                 a->prpl->set_my_name( a->ic, cmd[2] );
    1011         }
    1012 }
    1013 
    1014984static void cmd_qlist( irc_t *irc, char **cmd )
    1015985{
     
    10301000                else
    10311001                        irc_usermsg( irc, "%d, BitlBee: %s", num, q->question );
    1032 }
    1033 
    1034 static void cmd_join_chat( irc_t *irc, char **cmd )
    1035 {
    1036         irc_usermsg( irc, "This command is now obsolete. "
    1037                           "Please try the `chat' command instead." );
    10381002}
    10391003
     
    12161180        { "help",           0, cmd_help,           0 },
    12171181        { "account",        1, cmd_account,        0 },
    1218 #if 0
    12191182        { "identify",       1, cmd_identify,       0 },
    12201183        { "register",       1, cmd_register,       0 },
    12211184        { "drop",           1, cmd_drop,           0 },
     1185        { "save",           0, cmd_save,           0 },
     1186#if 0
    12221187        { "add",            2, cmd_add,            0 },
    12231188        { "info",           1, cmd_info,           0 },
     
    12281193        { "block",          1, cmd_block,          0 },
    12291194        { "allow",          1, cmd_allow,          0 },
    1230         { "save",           0, cmd_save,           0 },
    12311195        { "set",            0, cmd_set,            0 },
    12321196        { "yes",            0, cmd_yesno,          0 },
Note: See TracChangeset for help on using the changeset viewer.