projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release-0.6.5'
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
GetStatusAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
index
4e2049e
..
246cbed
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
@@
-19,7
+19,6
@@
package net.pterodactylus.sone.web.ajax;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
@@
-89,7
+88,7
@@
public class GetStatusAjaxPage extends JsonPage {
jsonSones.add(jsonSone);
}
/* load notifications. */
jsonSones.add(jsonSone);
}
/* load notifications. */
- List<Notification> notifications = ListNotificationFilters.filterNotifications(
new ArrayList<Notification>(webInterface.getNotifications().getNotifications()
), currentSone);
+ List<Notification> notifications = ListNotificationFilters.filterNotifications(
webInterface.getNotifications().getNotifications(
), currentSone);
Collections.sort(notifications, Notification.LAST_UPDATED_TIME_SORTER);
JsonArray jsonNotificationInformations = new JsonArray();
for (Notification notification : notifications) {
Collections.sort(notifications, Notification.LAST_UPDATED_TIME_SORTER);
JsonArray jsonNotificationInformations = new JsonArray();
for (Notification notification : notifications) {
@@
-128,6
+127,14
@@
public class GetStatusAjaxPage extends JsonPage {
});
}
});
}
+ /* remove replies to unknown posts. */
+ newReplies = Filters.filteredSet(newReplies, new Filter<Reply>() {
+
+ @Override
+ public boolean filterObject(Reply reply) {
+ return reply.getPost() != null;
+ }
+ });
JsonArray jsonReplies = new JsonArray();
for (Reply reply : newReplies) {
JsonObject jsonReply = new JsonObject();
JsonArray jsonReplies = new JsonArray();
for (Reply reply : newReplies) {
JsonObject jsonReply = new JsonObject();
@@
-137,7
+144,7
@@
public class GetStatusAjaxPage extends JsonPage {
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}
- return createSuccessJsonObject().put("sones", jsonSones).put("notifications", jsonNotificationInformations).put("newPosts", jsonPosts).put("newReplies", jsonReplies);
+ return createSuccessJsonObject().put("
loggedIn", currentSone != null).put("
sones", jsonSones).put("notifications", jsonNotificationInformations).put("newPosts", jsonPosts).put("newReplies", jsonReplies);
}
/**
}
/**