1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Reset autoconnect account when the account gets removed

When a user added an account, set it as autoconnect and then removed
that account. It still was set as the autoconnect account.

```
    /account add test
    /autoconnect set test
    /account remove test
    /save
    /quit
    Start profanity
```

Fix https://github.com/profanity-im/profanity/issues/1976
This commit is contained in:
Michael Vetter 2024-06-20 11:04:20 +02:00
parent 87935b744d
commit 5765edbe1b

View File

@ -569,6 +569,12 @@ cmd_account_remove(ProfWin* window, const char* const command, gchar** args)
}
cons_show("");
auto_gchar gchar* autocon_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
if (g_strcmp0(account_name, autocon_account) == 0) {
prefs_set_string(PREF_CONNECT_ACCOUNT, NULL);
cons_show("Autoconnect account reset because the corresponding account was removed.");
}
return TRUE;
}