mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 03:26:22 +00:00
Merge pull request #1113 from profanity-im/fix/1112-autoconnect
Check autoconnect set settings
This commit is contained in:
@@ -6555,12 +6555,20 @@ 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) {
|
||||
prefs_set_string(PREF_CONNECT_ACCOUNT, args[1]);
|
||||
cons_show("Autoconnect account set to: %s.", args[1]);
|
||||
if (args[1] == NULL || strlen(args[1]) == 0) {
|
||||
cons_bad_cmd_usage(command);
|
||||
} else {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user