mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Check if valid account before setting autoconnect
Fixes https://github.com/profanity-im/profanity/issues/1112
This commit is contained in:
parent
c03f936390
commit
53ef209272
@ -6555,12 +6555,16 @@ cmd_autoconnect(ProfWin *window, const char *const command, gchar **args)
|
||||
prefs_set_string(PREF_CONNECT_ACCOUNT, NULL);
|
||||
cons_show("Autoconnect account disabled.");
|
||||
} else if (strcmp(args[0], "set") == 0) {
|
||||
if (accounts_account_exists(args[1])) {
|
||||
prefs_set_string(PREF_CONNECT_ACCOUNT, args[1]);
|
||||
cons_show("Autoconnect account set to: %s.", args[1]);
|
||||
} else {
|
||||
cons_show_error("Account '%s' does not exist.", args[1]);
|
||||
}
|
||||
} else {
|
||||
cons_bad_cmd_usage(command);
|
||||
}
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user