From b2f195a15a31d5119e3b4ec20a4670acbfe10858 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Thu, 18 Jul 2024 12:01:52 +0200 Subject: [PATCH] remove reporting --- MareSynchronos/Plugin.cs | 1 - MareSynchronos/Services/Mediator/Messages.cs | 1 - MareSynchronos/UI/Components/DrawUserPair.cs | 12 ---- .../UI/Components/Popup/PopupHandler.cs | 8 --- .../UI/Components/Popup/ReportPopupHandler.cs | 59 ------------------- 5 files changed, 81 deletions(-) delete mode 100644 MareSynchronos/UI/Components/Popup/ReportPopupHandler.cs diff --git a/MareSynchronos/Plugin.cs b/MareSynchronos/Plugin.cs index a652bb1..240b266 100644 --- a/MareSynchronos/Plugin.cs +++ b/MareSynchronos/Plugin.cs @@ -136,7 +136,6 @@ public sealed class Plugin : IDalamudPlugin s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService())); collection.AddScoped(); - collection.AddScoped(); collection.AddScoped(); collection.AddScoped(); collection.AddScoped(); diff --git a/MareSynchronos/Services/Mediator/Messages.cs b/MareSynchronos/Services/Mediator/Messages.cs index 202db1c..c350a48 100644 --- a/MareSynchronos/Services/Mediator/Messages.cs +++ b/MareSynchronos/Services/Mediator/Messages.cs @@ -71,7 +71,6 @@ public record ProfileOpenStandaloneMessage(Pair Pair) : MessageBase; public record RemoveWindowMessage(WindowMediatorSubscriberBase Window) : MessageBase; public record PairHandlerVisibleMessage(PairHandler Player) : MessageBase; public record RefreshUiMessage : MessageBase; -public record OpenReportPopupMessage(Pair PairToReport) : MessageBase; public record OpenBanUserPopupMessage(Pair PairToBan, GroupFullInfoDto GroupFullInfoDto) : MessageBase; public record OpenCensusPopupMessage() : MessageBase; public record OpenSyncshellAdminPanel(GroupFullInfoDto GroupInfo) : MessageBase; diff --git a/MareSynchronos/UI/Components/DrawUserPair.cs b/MareSynchronos/UI/Components/DrawUserPair.cs index c79d0d0..8723bf7 100644 --- a/MareSynchronos/UI/Components/DrawUserPair.cs +++ b/MareSynchronos/UI/Components/DrawUserPair.cs @@ -151,18 +151,6 @@ public class DrawUserPair _ = _apiController.UserSetPairPermissions(new UserPermissionsDto(_pair.UserData, permissions)); } UiSharedService.AttachToolTip("Changes VFX sync permissions with this user." + (individual ? individualText : string.Empty)); - - if (!_pair.IsPaused) - { - ImGui.Separator(); - ImGui.TextUnformatted("Pair reporting"); - if (_uiSharedService.IconTextButton(FontAwesomeIcon.ExclamationTriangle, "Report Mare Profile", _menuWidth, true)) - { - ImGui.CloseCurrentPopup(); - _mediator.Publish(new OpenReportPopupMessage(_pair)); - } - UiSharedService.AttachToolTip("Report this users Mare Profile to the administrative team."); - } } private void DrawIndividualMenu() diff --git a/MareSynchronos/UI/Components/Popup/PopupHandler.cs b/MareSynchronos/UI/Components/Popup/PopupHandler.cs index 0734fdf..79853d8 100644 --- a/MareSynchronos/UI/Components/Popup/PopupHandler.cs +++ b/MareSynchronos/UI/Components/Popup/PopupHandler.cs @@ -32,14 +32,6 @@ public class PopupHandler : WindowMediatorSubscriberBase _handlers = popupHandlers.ToHashSet(); - Mediator.Subscribe(this, (msg) => - { - _openPopup = true; - _currentHandler = _handlers.OfType().Single(); - ((ReportPopupHandler)_currentHandler).Open(msg); - IsOpen = true; - }); - Mediator.Subscribe(this, (msg) => { _openPopup = true; diff --git a/MareSynchronos/UI/Components/Popup/ReportPopupHandler.cs b/MareSynchronos/UI/Components/Popup/ReportPopupHandler.cs deleted file mode 100644 index 57f144a..0000000 --- a/MareSynchronos/UI/Components/Popup/ReportPopupHandler.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Dalamud.Interface; -using Dalamud.Interface.Colors; -using Dalamud.Interface.Utility.Raii; -using ImGuiNET; -using MareSynchronos.PlayerData.Pairs; -using MareSynchronos.Services.Mediator; -using MareSynchronos.WebAPI; -using System.Numerics; - -namespace MareSynchronos.UI.Components.Popup; - -internal class ReportPopupHandler : IPopupHandler -{ - private readonly ApiController _apiController; - private readonly UiSharedService _uiSharedService; - private Pair? _reportedPair; - private string _reportReason = string.Empty; - - public ReportPopupHandler(ApiController apiController, UiSharedService uiSharedService) - { - _apiController = apiController; - _uiSharedService = uiSharedService; - } - - public Vector2 PopupSize => new(500, 500); - - public bool ShowClose => true; - - public void DrawContent() - { - using (_uiSharedService.UidFont.Push()) - UiSharedService.TextWrapped("Report " + _reportedPair!.UserData.AliasOrUID + " Mare Profile"); - - ImGui.InputTextMultiline("##reportReason", ref _reportReason, 500, new Vector2(500 - ImGui.GetStyle().ItemSpacing.X * 2, 200)); - UiSharedService.TextWrapped($"Note: Sending a report will disable the offending profile globally.{Environment.NewLine}" + - $"The report will be sent to the team of your currently connected Mare Synchronos Service.{Environment.NewLine}" + - $"The report will include your user and your contact info (Discord User).{Environment.NewLine}" + - $"Depending on the severity of the offense the users Mare profile or account can be permanently disabled or banned."); - UiSharedService.ColorTextWrapped("Report spam and wrong reports will not be tolerated and can lead to permanent account suspension.", ImGuiColors.DalamudRed); - UiSharedService.ColorTextWrapped("This is not for reporting misbehavior or Mare usage but solely for the actual profile. " + - "Reports that are not solely for the profile will be ignored.", ImGuiColors.DalamudYellow); - - using (ImRaii.Disabled(string.IsNullOrEmpty(_reportReason))) - { - if (_uiSharedService.IconTextButton(FontAwesomeIcon.ExclamationTriangle, "Send Report")) - { - ImGui.CloseCurrentPopup(); - var reason = _reportReason; - _ = _apiController.UserReportProfile(new(_reportedPair.UserData, reason)); - } - } - } - - public void Open(OpenReportPopupMessage msg) - { - _reportedPair = msg.PairToReport; - _reportReason = string.Empty; - } -} \ No newline at end of file