- protected JsonObject createJsonObject(FreenetRequest request) {
- Sone currentSone = getCurrentSone(request.getToadletContext(), false);
- Collection<Notification> notifications = webInterface.getNotifications().getNotifications();
- List<Notification> filteredNotifications = ListNotificationFilters.filterNotifications(notifications, currentSone);
- Collections.sort(filteredNotifications, Notification.CREATED_TIME_SORTER);
- JsonArray jsonNotifications = new JsonArray();
- for (Notification notification : filteredNotifications) {
+ protected JsonReturnObject createJsonObject(FreenetRequest request) {
+ Sone currentSone = getCurrentSoneWithoutCreatingSession(request.getToadletContext());
+ List<Notification> notifications = new ArrayList<Notification>(webInterface.getNotifications(currentSone));
+ Collections.sort(notifications, Notification.CREATED_TIME_SORTER);
+ ArrayNode jsonNotifications = new ArrayNode(instance);
+ for (Notification notification : notifications) {