From ab99deace640229c91c4b8e4581cd9351e542eb2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 5 Sep 2021 12:42:12 -0500 Subject: detect room config changes and auto-join --- src/slskd/Application/Application.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Application/Application.cs b/src/slskd/Application/Application.cs index f7488ef3..d5c0dcff 100644 --- a/src/slskd/Application/Application.cs +++ b/src/slskd/Application/Application.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -248,6 +248,13 @@ namespace slskd Logger.Information("File filter configuration changed. Shares must be re-scanned for changes to take effect."); } + if (PreviousOptions.Rooms.Except(newOptions.Rooms).Any() + || newOptions.Rooms.Except(PreviousOptions.Rooms).Any()) + { + Logger.Information("Room configuration changed. Joining any newly added rooms."); + _ = AutoJoinRooms(newOptions.Rooms); + } + // determine whether any Soulseek options changed. if so, we need to construct a patch // and invoke ReconfigureOptionsAsync(). var slskDiff = PreviousOptions.Soulseek.DiffWith(newOptions.Soulseek); -- cgit v1.2.3