/*
- * 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
Set<Sone> 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);
Set<Sone> sones = webInterface.getCore().getLikes(reply);
return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones));
}
* The Sones to convert to an array
* @return The Sones, sorted by name
*/
- private JsonArray getSones(Set<Sone> sones) {
+ private static JsonArray getSones(Set<Sone> sones) {
JsonArray soneArray = new JsonArray();
List<Sone> sortedSones = new ArrayList<Sone>(sones);
Collections.sort(sortedSones, Sone.NICE_NAME_COMPARATOR);