Skip to content
This repository has been archived by the owner on Nov 25, 2019. It is now read-only.

Make reports no longer show reports with offline reportees #78

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Make reports no longer show reports with offline reportees #78

wants to merge 5 commits into from

Conversation

PotatoStealer
Copy link

No description provided.

@@ -184,7 +189,7 @@ public void reports(final CommandContext args, final CommandSender sender) throw
audience.sendMessage(new HeaderComponent(title));
for(Report report : reportResult.documents()) {
if(report.reported() != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check if the player is offline here instead of in ReportFormatter. That would avoid calling audience.sendmessage() for a bunch of empty collections.

@cswhite2000
Copy link
Member

You seem to have removed the code that makes the o flag actually do anything. Also you should probably make it so when you use the a flag it shows players that are online on other servers not just the current one

@@ -1,12 +1,14 @@
package tc.oc.commons.bukkit.report;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes in reportformatter don’t seem to do anything. They can probably just be discarded.

@@ -183,8 +192,8 @@ public void reports(final CommandContext args, final CommandSender sender) throw
final Audience audience = audiences.get(sender);
audience.sendMessage(new HeaderComponent(title));
for(Report report : reportResult.documents()) {
if(report.reported() != null) {
audience.sendMessages(reportFormatter.format(report, crossServer, true));
if(report.reported() != null && onlinePlayers.find(report.reported()).isOnline()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

report.reported() != null && (showOffline || onlinePlayers.find(report.reported()).isOnline())

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to figure out how to get this to work with the a flag

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants