X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetLikesAjaxPage.java;h=c1c532b21c5da25abb4694ebdac17446d66acd7a;hb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792;hp=12a9e8d8c41617e95ff3aae976516fcf92b2f947;hpb=43a21f859e9fec31096c1540148bdd44a8e3702f;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java index 12a9e8d..c1c532b 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - GetLikesAjaxPage.java - Copyright © 2010 David Roden + * Sone - GetLikesAjaxPage.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ public class GetLikesAjaxPage extends JsonPage { Set sones = webInterface.getCore().getLikes(post); return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones)); } else if ("reply".equals(type)) { - PostReply reply = webInterface.getCore().getReply(id); + PostReply reply = webInterface.getCore().getPostReply(id, false); Set sones = webInterface.getCore().getLikes(reply); return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones)); } @@ -94,7 +94,7 @@ public class GetLikesAjaxPage extends JsonPage { * The Sones to convert to an array * @return The Sones, sorted by name */ - private JsonArray getSones(Set sones) { + private static JsonArray getSones(Set sones) { JsonArray soneArray = new JsonArray(); List sortedSones = new ArrayList(sones); Collections.sort(sortedSones, Sone.NICE_NAME_COMPARATOR);