/*
- * Sone - GetStatusAjaxPage.java - Copyright © 2010–2012 David Roden
+ * Sone - GetStatusAjaxPage.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
import net.pterodactylus.util.json.JsonArray;
import net.pterodactylus.util.json.JsonObject;
import net.pterodactylus.util.notify.Notification;
-import net.pterodactylus.util.object.HashCode;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
String[] soneIds = loadSoneIds.split(",");
for (String soneId : soneIds) {
/* just add it, we skip null further down. */
- sones.add(webInterface.getCore().getSone(soneId, false));
+ sones.add(webInterface.getCore().getSone(soneId));
}
}
JsonArray jsonSones = new JsonArray();
/* load notifications. */
List<Notification> notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone);
Collections.sort(notifications, Notification.CREATED_TIME_SORTER);
- int notificationHash = HashCode.hashCode(notifications);
/* load new posts. */
Collection<Post> newPosts = webInterface.getNewPosts();
if (currentSone != null) {
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}
- return createSuccessJsonObject().put("loggedIn", currentSone != null).put("options", createJsonOptions(currentSone)).put("sones", jsonSones).put("notificationHash", notificationHash).put("newPosts", jsonPosts).put("newReplies", jsonReplies);
+ return createSuccessJsonObject().put("loggedIn", currentSone != null).put("options", createJsonOptions(currentSone)).put("sones", jsonSones).put("notificationHash", notifications.hashCode()).put("newPosts", jsonPosts).put("newReplies", jsonReplies);
}
/**