diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java index fc752da26..882c5e634 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java @@ -126,7 +126,6 @@ public class ReportManager */ public CompletableFuture createReport(int reporterId, int suspectId, ReportCategory category, String message) { - // TODO only allow report if suspect actually did something return fetchOrCreateReport(suspectId, category).whenComplete((report, throwable) -> { if (report != null) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ui/ReportCategoryPage.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ui/ReportCategoryPage.java index abca84309..78baf386a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ui/ReportCategoryPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ui/ReportCategoryPage.java @@ -1,11 +1,15 @@ package mineplex.core.report.ui; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import mineplex.core.account.CoreClient; +import mineplex.core.chatsnap.SnapshotManager; +import mineplex.core.chatsnap.SnapshotMessage; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; @@ -69,7 +73,12 @@ public class ReportCategoryPage extends SimpleGui private boolean hasSentMessage(int accountId) { - return _plugin.getReportManager().getSnapshotManager().getMessagesFrom(accountId).size() > 0; + SnapshotManager snapshotManager = _plugin.getReportManager().getSnapshotManager(); + List suspectMessages = snapshotManager.getMessagesFrom(accountId).stream() + .filter(message -> message.getRecipientIds().contains(_suspect.getAccountId())) + .collect(Collectors.toList()); + + return suspectMessages.size() > 0; } private void createReport(ReportCategory category)