IRC: edit server settings as a draft, applied under the service lock

The IRC App edited the live config while the IRC task could be reading
it to connect. The App now edits a copy; applyConfig() validates it and
swaps it in under the lock, and the task connects from a snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-03 18:42:24 +02:00
co-authored by Claude Opus 5.5
parent 4cd6a63498
commit dd16352509
6 changed files with 69 additions and 25 deletions
+4 -3
View File
@@ -44,9 +44,10 @@ class IrcService : public Service {
}
int totalUnread();
IrcConfig& config() { return config_; }
// Saves the config and, if running, reconnects with it (a fresh session).
std::string saveConfig();
// A copy of the server settings to edit; applyConfig() validates, saves and, if running,
// reconnects with it (a fresh session).
IrcConfig draftConfig();
std::string applyConfig(const IrcConfig& draft);
private:
struct Lock {