aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-03-03 23:18:36 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-03-03 23:18:36 +0000
commit7f421d6b922837857d6aca342da314225023eb46 (patch)
tree46fc791329bc22af75e399d9d6901e46b548d0b4 /root_commands.c
parented3ae7e7d41f91917fc2ae92051c7c77c357fbab (diff)
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.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/root_commands.c b/root_commands.c
index 2f542826..9a60b5af 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -203,6 +203,26 @@ static void cmd_drop( irc_t *irc, char **cmd )
}
}
+void cmd_account_del_yes( gpointer w, void *data )
+{
+ account_t *a = data;
+ irc_t *irc = a->irc;
+
+ if( a->ic )
+ {
+ irc_usermsg( irc, "Account is still logged in, can't delete" );
+ }
+ else
+ {
+ account_del( irc, a );
+ irc_usermsg( irc, "Account deleted" );
+ }
+}
+
+void cmd_account_del_no( gpointer w, void *data )
+{
+}
+
static void cmd_account( irc_t *irc, char **cmd )
{
account_t *a;
@@ -257,8 +277,15 @@ static void cmd_account( irc_t *irc, char **cmd )
}
else
{
- account_del( irc, a );
- irc_usermsg( irc, "Account deleted" );
+ char *msg;
+
+ msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
+ "also forget all your saved nicknames. If you want "
+ "to change your username/password, use the `account "
+ "set' command. Are you sure you want to delete this "
+ "account?", a->prpl->name, a->user );
+ query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a );
+ g_free( msg );
}
}
else if( g_strcasecmp( cmd[1], "list" ) == 0 )