mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Free account_name preference on autoconnect
This commit is contained in:
parent
fa0be4e50e
commit
4a485a64f9
@ -171,7 +171,7 @@ prefs_get_string(preference_t pref)
|
|||||||
char *result = g_key_file_get_string(prefs, group, key, NULL);
|
char *result = g_key_file_get_string(prefs, group, key, NULL);
|
||||||
|
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
return def;
|
return strdup(def);
|
||||||
} else {
|
} else {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -72,15 +72,19 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
|
|||||||
|
|
||||||
ui_update_screen();
|
ui_update_screen();
|
||||||
|
|
||||||
|
char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
|
||||||
if (account_name != NULL) {
|
if (account_name != NULL) {
|
||||||
char *cmd = "/connect";
|
char *cmd = "/connect";
|
||||||
snprintf(inp, sizeof(inp), "%s %s", cmd, account_name);
|
snprintf(inp, sizeof(inp), "%s %s", cmd, account_name);
|
||||||
process_input(inp);
|
process_input(inp);
|
||||||
} else if (prefs_get_string(PREF_CONNECT_ACCOUNT) != NULL) {
|
} else if (pref_connect_account != NULL) {
|
||||||
char *cmd = "/connect";
|
char *cmd = "/connect";
|
||||||
snprintf(inp, sizeof(inp), "%s %s", cmd, prefs_get_string(PREF_CONNECT_ACCOUNT));
|
snprintf(inp, sizeof(inp), "%s %s", cmd, pref_connect_account);
|
||||||
process_input(inp);
|
process_input(inp);
|
||||||
}
|
}
|
||||||
|
if (pref_connect_account != NULL) {
|
||||||
|
free(pref_connect_account);
|
||||||
|
}
|
||||||
|
|
||||||
while(cmd_result == TRUE) {
|
while(cmd_result == TRUE) {
|
||||||
wint_t ch = ERR;
|
wint_t ch = ERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user