Make chat log clickable, only close report instruction line suggests command.

This commit is contained in:
Keir 2016-01-10 21:28:57 +00:00
parent bd865c7e64
commit 1c49e3a111

View File

@ -21,7 +21,7 @@ import org.apache.commons.lang3.StringUtils;
*/
public class ReportHandlerMessageTask extends BukkitRunnable
{
private static final String BORDER = C.cAqua + "------------------------------------";
private static final String DECORATION = C.cAqua + "------------------------------------";
private ReportManager _reportManager;
private Report _report;
@ -41,19 +41,21 @@ public class ReportHandlerMessageTask extends BukkitRunnable
{
String suspectName = Bukkit.getOfflinePlayer(_report.getSuspect()).getName();
JsonMessage jsonMessage = new JsonMessage(BORDER
+ "\n"
+ C.cAqua + "Reviewing Ticket " + C.cGold + "#" + reportId
+ "\n\n"
+ C.cPurple + StringUtils.join(getReportReasons(), "\n" + C.cPurple)
+ "\n\n"
+ C.cAqua + "Suspect: " + C.cGold + suspectName
+ "\n"
+ (_report.hasToken() ? C.cAqua + "Chat Log: " + C.cGold + SnapshotPublisher.getURL(_report.getToken()) + "\n" : "")
+ "\n"
+ C.cAqua + "Type " + C.cGold + "/reportclose " + reportId + " <reason>" + C.cAqua + " to close this report."
+ "\n"
+ BORDER).click(ClickEvent.SUGGEST_COMMAND, "/reportclose " + reportId);
JsonMessage jsonMessage = new JsonMessage(DECORATION)
.extra("\n")
.add(C.cAqua + "Reviewing Ticket " + C.cGold + "#" + reportId)
.add("\n\n")
.add(C.cPurple + StringUtils.join(getReportReasons(), "\n" + C.cPurple))
.add("\n\n")
.add(C.cAqua + "Suspect: " + C.cGold + suspectName)
.add("\n")
.add((_report.hasToken() ? C.cAqua + "Chat Log: " + C.cGold + "Click Here" + "\n" : ""))
.click(ClickEvent.OPEN_URL, SnapshotPublisher.getURL(_report.getToken()))
.add("\n")
.add(C.cAqua + "Type " + C.cGold + "/reportclose " + reportId + " <reason>" + C.cAqua + " to close this report.")
.click(ClickEvent.SUGGEST_COMMAND, "/reportclose " + reportId)
.add("\n")
.add(DECORATION);
new ReportHandlerNotification(_report, jsonMessage).publish();
}