diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-09-07 15:34:50 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-09-07 15:34:50 +0100 |
commit | ced1e17474366772791186f865bd45d4decfcaf2 (patch) | |
tree | 3461a801f9f6df2f084d1fa3a015cf4401f36d20 /root_commands.c | |
parent | d4810dff26f128061d122cf120e1e0174d9df1f2 (diff) | |
parent | ba3a8a578430418050a7fda3c949d65434b23cb3 (diff) |
Merging BitlBee 1.2.3 release.
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/root_commands.c b/root_commands.c index 67847650..8770e707 100644 --- a/root_commands.c +++ b/root_commands.c @@ -139,7 +139,7 @@ static void cmd_account( irc_t *irc, char **cmd ); static void cmd_identify( irc_t *irc, char **cmd ) { - storage_status_t status = storage_load( irc->nick, cmd[1], irc ); + storage_status_t status = storage_load( irc, cmd[1] ); char *account_on[] = { "account", "on", NULL }; switch (status) { @@ -151,6 +151,8 @@ static void cmd_identify( irc_t *irc, char **cmd ) break; case STORAGE_OK: irc_usermsg( irc, "Password accepted, settings and accounts loaded" ); + irc_setpass( irc, cmd[1] ); + irc->status |= USTATUS_IDENTIFIED; irc_umode_set( irc, "+R", 1 ); if( set_getbool( &irc->set, "auto_connect" ) ) cmd_account( irc, account_on ); @@ -170,14 +172,14 @@ static void cmd_register( irc_t *irc, char **cmd ) return; } - irc_setpass( irc, cmd[1] ); - switch( storage_save( irc, FALSE )) { + switch( storage_save( irc, cmd[1], FALSE ) ) { case STORAGE_ALREADY_EXISTS: irc_usermsg( irc, "Nick is already registered" ); break; case STORAGE_OK: irc_usermsg( irc, "Account successfully created" ); + irc_setpass( irc, cmd[1] ); irc->status |= USTATUS_IDENTIFIED; irc_umode_set( irc, "+R", 1 ); break; @@ -871,7 +873,9 @@ static void cmd_set( irc_t *irc, char **cmd ) static void cmd_save( irc_t *irc, char **cmd ) { - if( storage_save( irc, TRUE ) == STORAGE_OK ) + if( ( irc->status & USTATUS_IDENTIFIED ) == 0 ) + irc_usermsg( irc, "Please create an account first" ); + else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK ) irc_usermsg( irc, "Configuration saved" ); else irc_usermsg( irc, "Configuration could not be saved!" ); |