From 425d814ac4357553c53d533939415b09817848c5 Mon Sep 17 00:00:00 2001 From: Keir Nellyer Date: Wed, 14 Sep 2016 11:57:49 +0100 Subject: [PATCH] PC-966 When selecting a new report for a user to handle, always prioritise reports assigned to teams that the user is a member of --- .../core/report/command/ReportHandleCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java index 2f87d5bd2..161340cc8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportHandleCommand.java @@ -71,7 +71,17 @@ public class ReportHandleCommand extends CommandBase for (Map.Entry entry : reportPriorities.entrySet()) { - if (mostImportant == null || entry.getValue() > mostImportant.getValue()) + Report report = entry.getKey(); + double priority = entry.getValue(); + + // reports assigned to user team are always prioritised + if (report.getAssignedTeam().isPresent()) + { + mostImportant = entry; + break; + } + + if (mostImportant == null || priority > mostImportant.getValue()) { mostImportant = entry; }