projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add method to get all posts of a Sone to post provider interface.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
MarkAsKnownAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
index
fec5800
..
6610971
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
@@
-59,11
+59,11
@@
public class MarkAsKnownAjaxPage extends JsonPage {
Core core = webInterface.getCore();
for (String id : ids) {
if (type.equals("post")) {
Core core = webInterface.getCore();
for (String id : ids) {
if (type.equals("post")) {
-
Post
post = core.getPost(id);
- if (
post == null
) {
+
Optional<Post>
post = core.getPost(id);
+ if (
!post.isPresent()
) {
continue;
}
continue;
}
- core.markPostKnown(post);
+ core.markPostKnown(post
.get()
);
} else if (type.equals("reply")) {
Optional<PostReply> reply = core.getPostReply(id);
if (!reply.isPresent()) {
} else if (type.equals("reply")) {
Optional<PostReply> reply = core.getPostReply(id);
if (!reply.isPresent()) {
@@
-71,11
+71,11
@@
public class MarkAsKnownAjaxPage extends JsonPage {
}
core.markReplyKnown(reply.get());
} else if (type.equals("sone")) {
}
core.markReplyKnown(reply.get());
} else if (type.equals("sone")) {
-
Sone sone = core.getSone(id, false
);
- if (
sone == null
) {
+
Optional<Sone> sone = core.getSone(id
);
+ if (
!sone.isPresent()
) {
continue;
}
continue;
}
- core.markSoneKnown(sone);
+ core.markSoneKnown(sone
.get()
);
}
}
return createSuccessJsonObject();
}
}
return createSuccessJsonObject();