From 9bc2ad24cd752d3b3e060c2017450d2dbfa4fdf5 Mon Sep 17 00:00:00 2001 From: azyges Date: Fri, 26 Sep 2025 04:51:05 +0900 Subject: [PATCH] clearing syncshell from lightfinder users --- LightlessAPI | 2 +- LightlessSync/UI/SyncshellAdminUI.cs | 20 +++++++++++++++---- LightlessSync/UI/SyncshellFinderUI.cs | 2 +- .../SignalR/ApiController.Functions.Groups.cs | 5 +++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/LightlessAPI b/LightlessAPI index d62adbb..3c10380 160000 --- a/LightlessAPI +++ b/LightlessAPI @@ -1 +1 @@ -Subproject commit d62adbb5b61ee12fc62e43cd70fb679eb2bcd1e4 +Subproject commit 3c10380162b162c47c99f63ecfc627a49887fe84 diff --git a/LightlessSync/UI/SyncshellAdminUI.cs b/LightlessSync/UI/SyncshellAdminUI.cs index 3dd90de..fb30067 100644 --- a/LightlessSync/UI/SyncshellAdminUI.cs +++ b/LightlessSync/UI/SyncshellAdminUI.cs @@ -336,7 +336,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase } ImGui.Separator(); - if (_uiSharedService.MediumTreeNode("Mass Cleanup", UIColors.Get("LightlessPurple"))) + if (_uiSharedService.MediumTreeNode("Mass Cleanup", UIColors.Get("DimRed"))) { using (ImRaii.Disabled(!UiSharedService.CtrlPressed())) { @@ -348,6 +348,18 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase UiSharedService.AttachToolTip("This will remove all non-pinned, non-moderator users from the Syncshell." + UiSharedService.TooltipSeparator + "Hold CTRL to enable this button"); + ImGui.SameLine(); + + using (ImRaii.Disabled(!UiSharedService.CtrlPressed())) + { + if (_uiSharedService.IconTextButton(FontAwesomeIcon.Brush, "Clear Lightfinder Users")) + { + _ = _apiController.GroupClearFinder(new(GroupFullInfo.Group)); + } + } + UiSharedService.AttachToolTip("This will remove all users that joined through Lightfinder from the Syncshell." + + UiSharedService.TooltipSeparator + "Hold CTRL to enable this button"); + ImGuiHelpers.ScaledDummy(2f); ImGui.Separator(); ImGuiHelpers.ScaledDummy(2f); @@ -410,12 +422,12 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase UiSharedService.TextWrapped($"Syncshell was pruned and {_pruneTask.Result} inactive user(s) have been removed."); } } - _uiSharedService.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f); + _uiSharedService.ColoredSeparator(UIColors.Get("DimRed"), 1.5f); ImGui.TreePop(); } ImGui.Separator(); - if (_uiSharedService.MediumTreeNode("User Bans", UIColors.Get("LightlessPurple"))) + if (_uiSharedService.MediumTreeNode("User Bans", UIColors.Get("LightlessYellow"))) { if (_uiSharedService.IconTextButton(FontAwesomeIcon.Retweet, "Refresh Banlist from Server")) { @@ -456,7 +468,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase } ImGui.EndTable(); } - _uiSharedService.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f); + _uiSharedService.ColoredSeparator(UIColors.Get("LightlessYellow"), 1.5f); ImGui.TreePop(); } ImGui.Separator(); diff --git a/LightlessSync/UI/SyncshellFinderUI.cs b/LightlessSync/UI/SyncshellFinderUI.cs index 291cce6..6f4050e 100644 --- a/LightlessSync/UI/SyncshellFinderUI.cs +++ b/LightlessSync/UI/SyncshellFinderUI.cs @@ -189,7 +189,7 @@ public class SyncshellFinderUI : WindowMediatorSubscriberBase finalPermissions.SetDisableAnimations(_ownPermissions.DisableGroupAnimations); finalPermissions.SetDisableVFX(_ownPermissions.DisableGroupVFX); - _ = _apiController.GroupJoinFinalize(new GroupJoinDto(_joinDto.Group, _joinDto.Password, finalPermissions, true)); + _ = _apiController.GroupJoinFinalize(new GroupJoinDto(_joinDto.Group, _joinDto.Password, finalPermissions)); _joinDto = null; _joinInfo = null; } diff --git a/LightlessSync/WebAPI/SignalR/ApiController.Functions.Groups.cs b/LightlessSync/WebAPI/SignalR/ApiController.Functions.Groups.cs index cd17ea8..c7581d1 100644 --- a/LightlessSync/WebAPI/SignalR/ApiController.Functions.Groups.cs +++ b/LightlessSync/WebAPI/SignalR/ApiController.Functions.Groups.cs @@ -45,6 +45,11 @@ public partial class ApiController CheckConnection(); await _lightlessHub!.SendAsync(nameof(GroupClear), group).ConfigureAwait(false); } + public async Task GroupClearFinder(GroupDto group) + { + CheckConnection(); + await _lightlessHub!.SendAsync(nameof(GroupClearFinder), group).ConfigureAwait(false); + } public async Task GroupCreate() {